Wikipedia actually has a page devoted to the 38-item-long list of possible etymologies of the word OK, so obviously its origin is somewhat under contention. While there have been roots proposed from Choctaw to West African to Greek, there is one theory that seem most likely. In the late 1830s, a slang fad originated in Boston, where people would ironically misspell words. One of the most whimsical of these alterations was oll korrect, but it would have died out with the rest if not for Martin Van Buren's 1840 re-election campaign. His slogan was OK Club, his voters being in the 'club' and his home, Old Kinderhook, NY, being the OK. It connected with his fans on a more personal level and was easier to say than Van Buren Club. However, it allowed the opposition in Boston to start jokingly calling it the oll korrect club, and, eventually, it lost the sarcastic connotation and started to just mean "good". Okay developed on a phonetic basis in the early twentieth centuries.
Adam Aleksic, a leading contender for valedictorian of his high school, is a 214-month-old boy with disturbing interests in etymology, vexillology, geography, and law. Adam would like to one day visit Tajikistan and probably isn't spying for the Uzbek government.
The Etymology Nerd