All I can reply to that is how do you NOT see the connection?
Because pain is pain is pain. There's real parenting experts out there who say you should always use a paddle or switch when you spank a child, because a parent's hand should never be used to hurt or punish. There's other ones who say a paddle or switch is abusive. Me... I think a paddle can be applied lovingly and a hand can be applied abusively. I don't think it's HOW you cause the physical pain that matters. I think it's the fact that you are using pain as a method of punishment that matters.
That's why I don't see the difference between a spank and a shock (and no, I'm not talking about a big jolt, any more than I mean beating the kid bloody when I say "spank").
And there is your answer to the above.
And no, I would not spank my child for trying to touch a hot burner. I would yell "NO" or "STOP" (although there are people on this board who will say they've never even done that). So no, in THAT situation it is not comparable. However, analogies rarely use the same situation. If yelling "NO" to my child was adequate for every situation, I would have never spanked, I'll give you that one.
As I said, people will do what they think is right, and odds are their kids will turn out fine, because they have loving, thoughtful parents. But you know something? I wouldn't be trying sixteen other things before finally giving in and spanking.
Maybe the parent whose kid requires seventeen different punishments should go right to spanking, if that's what ultimately works. Why even bother with other punishments?

I'm not convinced, however, that my personal goal is just to do whatever works.
Would you spank a kid if they bit you?
When my daughter was almost three, I bent down to pick up some toys. She BIT me on the butt! I whipped around and grabbed her arms. "WHY did you do that!?"
Sobbing, she said, "It seemed like a good idea at the time!"
I didn't punish her. What would be the point? She was already sorry. I had her pick up the rest of her toys by herself instead. Bite me and I won't help you!
In this case she did it (because she was sorry), but there were other times when she refused to put her toys away. I didn't spank her for defiance. I put the toy in her hand and led her over the toybox and dropped it in. Repeat ad infinitum ad nauseum. She eventually got the idea that it was easier to cooperate. And more fun!
I always told the kids - "It's my job to show you the right thing to do, and to make sure you do it, until you're old enough to do it yourselves." I don't think spanking would have helped me achieve this goal.