Abbreviation for 'oll korrect', from 1839-March.
Abbreviation fad begun in Boston, 1838-summer which spread to New York and New Orleans in 1839. Other Bostonian newspaper referrences included: OFM - our first men; NG - no go; GT - gone to Texas; SP - small potatoes.
Many abbreviated expressions were exaggerated misspellings: OW - oll wright; KY - know yuse; KG - know go; NS - nuff said.
In 1840 supporters of Martin 'Old Kinderhook' Van Buren adopted OK as the name of their political club, Kinderhook being a region of New York.
As explained by Allen Walker of Columbia University in the journal American Speech, 1963-4.