The pillory is one of the most effective restraints ever invented, as countless people have discovered to their dismay over the centuries. The pillory is perfectly designed to render the occupant utterly helpless, no matter how vigorously he or she struggles to escape its wooden embrace.
Perhaps this is why the pillory is sometimes used in the art of escapology. The more challenging the restraint, the more impressive the escape.
The act usually involves a volunteer from the audience being locked in the pillory. He or she is left to struggle for a short while, to demonstrate that it is a genuine pillory from which escape is "impossible". The performer is locked in the pillory by his or her assistant, who pulls a screen around the device. The performer then miraculously escapes from the pillory and emerges to audience acclaim. Sometimes the screen is removed by the magician, revealing that his or her assistant is now trapped in the pillory.
It would of course be impossible to escape from a genuine properly fitting pillory. Even if the performer had a key in each hand and another between his or her teeth, it would not be possible to reach the padlock(s) securing the pillory. It is also suspicious that the performer only ever makes his or her escape when obscured behind a screen.
It follows that the pillory must have some sort of secret mechanism allowing the performer to extricate himself. On this premise, the act is technically a magic trick rather than escapology. But let us not spoil the illusion; it is still a good trick.
Here are a few pictures of pillories being used by escapologists:
There are other magical illusions which feature stocks:
Assistant's Revenge: the magician and assistant change places.
Stocks of Zanzibar: a variation on the Assistant's Revenge.
Chinese Water Torture: the magician's ankles are secured in stocks before being plunged into a water filled cabinet.
The classic sawing in half illusion.
The guillotine illusion.