Battery capacity is typically measured in milliamp-hours, or how many milliamps you can draw from a battery for how many hours? If you can draw 200 milliamps for 8 hours, then the capcity is 1600 mAh. The only way to actually measure the capacity is to do just that, drawing a known current and measuring the time until the battery is exhausted (or reaches some voltage that you set as the minimum). Some battery testers will try to measure the remaining capacity without discharging the battery, but this is not accurate.
When comparing batteries of different voltages (for instance 1.2V NiMH vs. 3.6V li-ion), you have to determine the total energy of the cell. Power (P, measured in watts) is equal to electromotive force (V, measured in volts) times the current (I, measured in amps). So, for instance, a 60-watt lightbulb requires 60 watts of power to light up. But the power company bills you for watt-hours (converted to kilowatt-hours), because the total energy (E) they sold you is based on how many watts you were using for how long (t, time). For burning a 60-watt bulb for 24 hours, you would have to pay for 1440 watt-hours (or 1.440 kilowatt-hours).
P = I * V
E = P * t
Ideally, the capacity of a battery would also be measured in watt-hours. So if you have a 1.2 volt 2000 mAh NiMH battery, then it holds 1.2*2000 = 2400 milliwatt-hours of energy. A similar size li-ion battery might be rated at only 750 mAh, but the voltage on that battery is 3.7 volts. So it actually has 3.7*750 = 2775 milliwatt-hours of energy available for you to use (realistically the voltage of any battery starts higher than the nominal voltage, so voltage starts higher and then goes down, which would affect these calculations).
As long as you are comparing one 3.7V li-ion battery to another or one 1.2V NiMH battery to another, you can talk about mAh as a measure of the battery capacity. And everyone does just that. But don't make the mistake of comparing a 750 mAh li-ion to a 2000 mAh NiMH.
Many people will use a single 18650 li-ion battery in the place of 2 16340 li-ion batteries (rechargeable CR123A cells). An 18650 battery might have 2200 mAh capacity. The 16340 might have 750 mAh. Because the two 16340's are in series, the voltage doubles to 7.4 volts but the 750 mAh stays the same (if the two batteries were in parallel, the voltage would stay the same but you would add the mAh). So the total energy of the two 16340's is 7.4*750=5550 milliwatt-hours. But the energy of the 18650 is 3.7*2200=8140 milliwatt-hours.
There is more to a good battery than its measured capacity. An LED might draw 1 amp of current at 3 volts. So that is 3 watts or 3000 milliwatts. If you have a 2400 milliwatt-hour NiMH battery (whose 1.2 volts of power are being boosted to 3 volts to run the LED) then you can figure that you could run the LED for 2400mW*hr/3000mW=0.8 hours, or 48 minutes. But you're having to provide a lot of current (I=P/E) of 3/1.2=2.5 amps. That's a lot for any battery to deliver and it will at least get very hot and may only be able to drive the LED at something less than 3 watts. So the ability of a battery to deliver a high current is also important. "High drain" devices require more current.
Cells that have high internal resistance will not be able to deliver the same current as ones that have less internal resistance. Alkaline batteries have higher internal resistance than NiMH batteries.