The term OK can not be searched back to any one original source. AskOxford suggests:
Most of them are undoubtedly pure speculation. It does not seem at all likely, from the linguistic and historical evidence, that it derives from the Scots expression ‘och aye’, the Greek ola kala (’it is good’), the Choctaw Indian oke or okeh (’it is so’), the French aux Cayes (’from Cayes’, a port in Haiti with a reputation for good rum) or au quai (’to the quay’, as supposedly used by French-speaking dockers), or the initials of a railway freight agent called Obediah Kelly who is said to have written them on lading documents he had checked.
It can be found in written form in 1814 meaning Old Kinderhook, which was used as a nickname for Martin Van Buren in his re-election campaing. Supporters formed the OK Club.
Others have speculated that the term came to wide use in the 1930s when there was a preponderance for humorous misspelling of words. The term all correct, was spelled as orl korrekt, leading to the abbreviation ok.