I find it entertaining.
Having lived for 54 years in Britain, I'm not aware I ever "swore allegiance " to anyone or anything, under god, heaven or anywhere else, so let's bury that idea right now.
Um... natural born citizens don't have to swear an oath of allegiance, but naturalised citizens have to. The specific wording of the oath at present is:
"I... swear by Almighty God that, on becoming a British citizen, I will be faithful and bear true allegiance to Her Majesty Queen Elizabeth the Second, Her Heirs and Successors according to law."
They also have to make a pledge:
"I will give my loyalty to the United Kingdom and respect its rights and freedoms. I will uphold its democratic values. I will observe its laws faithfully and fulfil my duties and obligations as a British citizen."
A military officer in theory is granted his commission by the king or queen, so maybe he has to swear allegiance
No theory about it. And the same goes for Police Officers, and indeed any officers of the crown.
but I expect American soldiers do something generically similar (and equally symbolic)
The US Oath of Enlistment is:
I, (NAME), do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; and that I will obey the orders of the President of the United States and the orders of the officers appointed over me, according to regulations and the Uniform Code of Military Justice. So help me God.
And I don't think you can call either oath "symbolic". Importantly, with regards to the British Oath, it means that if parliament does anything illegal the Crown can take command of the police and/or military in order to reassert Democracy. Of note, this is much clearer in regards to the Commonwealth Oaths. With the US Oath, they simultaneously swear to the Constitution and the President, forcing them to make a judgment call when they believe the President is in conflict with the Constitution.
No such dilemma exists for the soldiers of, say, the UK