Example: Larry realised his friends had been pulling his leg, but only after he turned up to the party as the only person in fancy dress. Doubly unfortunate was his choice of a French maid’s outfit.
There are two widely discounted theories to why you might have your leg pulled, rather than another part of your anatomy.
In Victorian London, street thieves would tackle their victims by their legs, or trip them up with strings or wires. Once down, they were easy targets. Iddy thinks this is a little bit vague and not clearly related to its current usage.
Still in good olde London, executions at Tyburn were often carried out via hanging by suspension. This grisly method did not employ a long drop which would normally break the victim’s neck. Instead, it left them dangling on the rope until they died of strangulation. It is said that relatives of the soon to be departed hired men to grab them by the legs and pull down with all their might in hopes of speeding up the process, and reducing the suffering. This, Iddy says, seems to be even more unrelated to its usage than the first explanation. He also adds that there seems to be a desire to connect all unknown origins to the ghastliest stories possible.
The idiom does, in fact, seem to originate from 19th century America, not London at all. It had a different meaning in its earlier inception, that of asking for something, usually money. If somebody was pulling your leg, they were probably hitting you up for a short-term loan.
Not to be outdone, the British have added an extension to the base idiom. “Pull the other one. It has bells on.”