First off, pain actually comes from your brain, not the hot stove. When you touch the hot stove, the nerves on your hand are alerted and an electrical signal is shot up to your brain. Your brain senses that you are in some kind of danger and sends back down a signal of pain to make you pull away. As much as we hate pain, we couldn't live without it. If you couldn't feel pain, you'd keep your hand on the stove, and I'm sorry but there's really no way to turn that into a positive. Thanks to your brain's quick action, you'd snatch your hand away and likely yell "ouch!" or "ow!" along with "$#&%." Why do we do this? Well it could actually be because of distraction.
Yelling "ouch" over and over or swearing after you experience pain can actually distract you from it. Mythbusters tried it, and it turned out not to be a myth at all. While plunging their hands in ice cold water, the group would shout out random words on the first test and swear words on the second test. Results showed that the group on average was able to withstand the icy water 30 pecent longer while swearing. PSA. don't turn into a walking explicit label after you stub your toe: your mom won't appreciate it. Do what I do: stop, drop, roll, and sob. You don't have to be on fire to do it. That's a myth.
The same experiment was also done at the University of Singapore. 56 participants kept their hands in icy water while either saying "ow" repeatedly, listening to a recording of someone saying it, or not hearing anything at all. With the tests, subjects who said "ow" repeatedly were able to last 7 seconds longer than without saying or hearing "ow" and listening to someone else say it. The hypothesis of the researchers was that when people use their vocals after pain, it disrupts the pain receptors, distracting you and helping you cope. But I still haven't answered my own question: why do we say "ow" and "ouch?"
Well, there is no real proven reason actually. The main theory, and possibly the obvious reason is that it is just a habit that we've all picked up hearing everyone else say it. Another possible theory is that we say it because our mouths naturally make an O shape, but again that's not proven, and is also less likely as many non-English speakers don't say "ow", but rather "aie!", "aui!", "av!", etc.
While there seems to be science that shows using your vocals may help you tolerate pain a little better, you already know that won't eliminate the pain completely. So if you're planning on belly-flopping off the rock quarry into the lake later, don't count on "ouch" being there to save you afterwards.
*citations: Huffington Post, Discovery. photo credits Jokideo.