It's a great comparison, and related to the folk wisdom of "you catch more flies with honey." Using punishment on animals often causes avoidance and aggression, which isn't usually the overt objective.
So maybe we shouldn't be surprised when punishing coworkers causes avoidance and aggression (especially when we are not being genuinely constructive or don't have solid reasoning). And maybe we should recognize that this isn't usually what we want for an institution primarily oriented toward building useful products.
Then a big question is why people keep repeating abusive cycles even when they manifestly doesn't work. Maybe they think these things work despite abundant disconfirming evidence. But I think a more common answer is that making things work in that sense isn't a real objective. The real objective is to exercise their own aggression and show dominance because that's what works for them. The bad dog owner doesn't really kick the dog for pooping on the carpet to make it stop, but because it's gratifying to kick the dog and have it be afraid. If the poop is not an undesired outcome, but only a sign of insufficient submission, then it is a sufficient correction to convincingly reassert dominance (and no dog wants to be kicked).
If our response to punishment-induced avoidance, as in much of this HN thread, is then to tear the avoiders down socially for not heeding our manifestly expert criticisms, I think what's going on is probably more about entitlement to aggression and reinforcement of dominance than productivity of the relationship. We might believe or state that we are offering helpful but unpleasant medicine, but if our response to the patient not taking it is some kind of social aggression rather than anything effective, that suggests our unstated emotional reasons are not as we would have others believe.
This attitude fits with the tech idea that the social structure, the company, etc. are actually meritocracies. Actual meritocracy sounds fine, but the ideology that we are IN a meritocracy has other uses. If I am in a position to abuse you, I will naturally tend to believe that this is because I am actually better than you and I am entitled to abuse you. In turn, I may accept this system because eventually seniority will allow me to become the abuser. Like dedovshchina and institutions at many boys' schools and fraternities, and exactly like tech hiring as well.