Phrase Origins says "...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)."
I've heard of another source for this that's to do with the need for a male to urinate during sleep, and so waking with an erection. (A '****-proud'). After urinating, the erection goes, So by 'extracting, (or taking), the p1ss' you're deflating the other person's ego. Then take Clanad's Michael Bliss connection to get 'Taking the Mick'.