Etymology is fun. Words are fascinating:
1839, only survivor of a slang fad in Boston and New York c.1838-9 for abbreviations of common phrases with deliberate, jocular misspellings (cf. K.G. for “no go,” as if spelled “know go”); in this case, “oll korrect.” Further popularized by use as an election slogan by the O.K. Club, New York boosters of Democratic president Martin Van Buren’s 1840 re-election bid, in allusion to his nickname Old Kinderhook, from his birth in the N.Y. village of Kinderhook. Van Buren lost, the word stuck, in part because it filled a need for a quick way to write an approval on a document, bill, etc. The noun is first attested 1841; the verb 1888. Spelled out as okeh, 1919, by Woodrow Wilson, on assumption that it represented Choctaw okeh “it is so” (a theory which lacks historical documentation); this was ousted quickly by okay after the appearance of that form in 1929. Okey-doke is student slang first attested 1932. Greek immigrants to America who returned home early 20c. having picked up U.S. speech mannerisms were known in Greece as okay-boys, among other things.
O.E. boc “book, writing, written document,” traditionally from P.Gmc. *bokiz “beech” (cf. Ger. Buch “book” Buche “beech;” see beech), the notion being of beechwood tablets on which runes were inscribed, but it may be from the tree itself (people still carve initials in them). The O.E. originally meant any written document. Latin and Sanskrit also have words for “writing” that are based on tree names (“birch” and “ash,” respectively). Meaning “libretto of an opera” is from 1768. Verb meaning “to enter for a seat or place, issue (railway) tickets” is from 1841; “to engage a performer as a guest” is from 1872. A betting book is from 1856; bookmaker in the wagering sense is from 1862.