If you want to become a professional sword swallower you have to learn to suppress your gag reflex.
When something that you're not supposed to swallow, like a sword, touches the soft palate, it sends signals to the medulla, a part of the brain responsible for regulating reflexes. The medulla sends a signal back that triggers the gag reflex. The walls of your pharynx contract to prevent whatever's in the back of your throat from going any farther.
Did you know that professional sword swallowing doesn't actually involve swallowing at all? Once you learn to stop gagging, you just push the sword down your esophagus and into your stomach.
However, one wrong move and you can puncture your windpipe or stomach. Many amateur sword swallowers actually die while attempting to swallow the sword. Here's what is says on the website swordswallow.com: "Sword swallowing is a life threatening activity. Many deaths and serious medical complications have arisen from attempting this most dangerous of performance arts."