One of the most widely accepted origins is that OK stands for oll (or orl) korrect - 'a factitious early 19th century American phonetic spelling of all correct,' according to the Encarta Dictionary.
I was under the impression that an inspector for a prominent industry (car manufacturer?) held the initials O.K. and would use this to identify products that had passed his scrutiny.