To start, lets clarify:
Wh (watt-Hours) is a unit of energy. It is interchangeable with 'capacity' in this context - because a batteries 'capacity' is the total amount of energy it is capable of storing.
A 40 Wh battery means that the battery can power a 1-watt device for 40 hours. Alternatively, it can power a 40-watt device for 1 hour.
The Watt is a unit of power, and in the case of electrical power it is calculated by Volts x Amps. (Voltage x Current).
So, a device with a voltage of 2V, and a current of 0.5A, is 1-watt. A device with a voltage of 1V and a current of 1A is also 1-watt.
To derive the battery life, in hours, we first calculate the power, in watts. We divide the battery capacity (in Wh) by this number, to get the number of hours.
For example, if a device has a 40 Wh battery, runs at a voltage of 4V, and a current of 0.5A:
Power: 4 x 0.5 = 2W
Battery life = 40 / 2 = 20 hours.
Thus, going back to the original point being made which started this whole debate, it is possible for the same capacity of battery to deliver different battery life, depending on the wattage of the device it has to power (which is obvious). However, all 40 Wh batteries have the same capacity, regardless of the device they are attached to.