I don’t know the United Kingdom’s rules and regs on the matter, especially taking into consideration they’re members of royalty, so my answer is based on my status as a veteran of the US Armed Forces.
In the US, there are certain conditions and situations under which the military uniform can be worn by veterans and retirees. One cannot, however, pose as or attempt pose as an active duty servicemember, nor exact/exert any military authority.
~
I’m willing to bet that being in the Royal Family, there are probably certain events or functions wherein they are required to be in uniform.
~