Britons have been using this figure of speech for decades, if not centuries. A "Mickey" of course, is a "Mick": a pejorative, racist term for an Irishman (so nicknamed because so many Irish surnames begin with Mc- or Mac-) It is a common stereotype, in both the UK and USA, that Irish men have volatile tempers, like to brawl, and make good boxers. So, To "take the Mickey (out of someone)" means to take the fight, the vigor, the gravity, the self-importance out of them, by mocking them, usually in a very subtle way.
Student: "Oh yes, we will sir. We'll even wear our school blazers to bed."
Headmaster: "If I didn't know better, I'd think you were trying to take the Mickey out of me!"