FEW English word origins spark more debate than that surrounding OK or okay. Alleged origins include Germany, the United States (American English and the Choctaw and Iroquois languages), France and West Africa. Some of the claims are quite plausible, although no one can ever be certain of the origin of words such as OK, because people in oral cultures leave no hard evidence. But the weight of what evidence there is suggests the United States in the 1830s.
Professor Alan Read, of Columbia University, spent two decades searching for the origin of OK, and about 1961 he found what is believed to be the earliest printed reference. It was in the Boston Morning Post, on March 23, 1839, and it was used as an abbreviation for Orl Korrect.
Bill Bryson, in Made in America (Secker & Warburg 1994) points out that in the 1830s there was a fashion for this sort of jocularly illiterate abbreviation. Others include KY for no use (know yuse); KG for no go (know go); and NS for 'nuff sed.
In 1840 Martin Van Buren ran for US president. He was known as Old Kinderhook, and the "Democratic OK Club" was formed to promote him. This seems to have been the impetus, possibly aided by the similarity with the Scottish och aye for OK to enter the language across the US, and to stay there and eventually to spread into many languages around the world.
Mind you, not all etymologists agree (some are quite fierce in their promotion of other possible origins) but evidence rules, OK?
Word for Word articles