Partridge's "Dictionary of Slang and Unconventional English" dates this expression to c. 1950, and gives its origin as rhyming slang ("Mickey Bliss"). Mickey Bliss, thought to be BBC radio personality, has never been conclusively identified.
A competing theory is that "taking the mick" was derived from the verb, "micturate" (to urinate).