Usually though, batteries are designed with a particular application in mind and that application will define a voltage that is acceptable, such as ~3.8V for phones or ~19V for laptops. Significantly above this would damage the device. Likewise, below that voltage and the device doesn't function. This is why mAh is a decent proxy for Wh; for a given application the voltage is fixed and so the conversion - for that application - is fixed. mAh for a given application can be compared easily.
Comparing batteries for different applications is harder, but not just because you have to convert mAh to Wh: different applications require different performance characteristics beyond just voltage. You might care about weight, physical dimensions, operating temperatures, discharge rates, charge rates, self-discharge rates, output impedance.