There is a major difference between whipping for pleasure and flogging for punishment.
People who enjoy being beaten to the point of months-long recovery and permanent, crippling injury are very rare.
Yeah for the most part "Kinky" things produce mostly superficial pain. Causing cuts and bruises. While a step up from there, more extreme, are just bleeding cuts that don't go too deep. (In fact as far as I am aware the entire goal of SM is to inflict pain without injury or risk of injury.)
Flogging outright slices up tissue and muscle. It is more akin to flaying. Even with modern medicine a flogging would be devistating on the human body.
Any person who would find pleasure in that... would be the same kind of person who enjoys being shot, having their limbs broken, and beaten half to death. It is MUCH less "Kinky" and more "They have a severe mental problem" in a similar way that people who can't feel pain have a serious problem.
I imagine humas would do the whipping while dwarves would keep hammers
Humans had a wide variety of punishments as well the punishment systems were often VERY skewed towards execution and extreme punishment. One of the major differences between the justice system now and only 100-200 years ago is the amount of crimes that are considered "serious".
Jail itself was horrible (yeah you had a good chance of dying there too). Dwarf Fortress Jail is practically luxurious (though given its use, perhaps that is the point. Fortress Jails may not actually be intended to be like a normal jail, but a less harmful one. Which to admit some castles had rather tollerable jails compared to city jails)