Tommy is used as a generic term for a British soldier, in much the same way that 'Fritz' is used for Germans. This is of course extremely closed minded racial prejudice, which I do not support, blah, blah, blah...

It comes from the first ever entry in the first ever paybook in the British army, where the Duke of Wellington filled in as an example the name 'Thomas Atkins'. The name was used mainly in WWI, where it was also used generically for any Commonwealth soldier, despite the fact that ANZAC soldiers would have felt marginalised and left out. In fact, they did anyway, believing their contribution to the war was undervalued. It wasn't. Although Gallipoli was a failure, it remains one of the most famous battles of the war.