How to calculate battery capacity from its size?
Best approach: look up the capacity in the datasheet.  If the battery doesn't have the datasheet, get a different battery that has got the datasheet.

Other approaches may be more trouble than they are worth [at least in the developed world they are].  So, I should probably stop writing now.

Empirical approach.  Suppose, for the purposes of cultural enrichment, you want to go through the exercise of guessing the size of the battery.  Identify the battery chemistry (probably Li-something in your case).  Capacity is more a less proportional to the volume of the battery.  Find batteries with the same chemistry that have known capacity.  Plot the capacity [mAh] vs. volume [cm3].  Find where your battery x fits on the curve.  You might be able to guess within a factor of 2x that way (you can get luckier than 2x, but not more accurate).

Experimental approach.  Charge the battery.  Discharge through battery analyzer (battery profiler).