I may be wrong here, but this came up when I was a supervisor in a hall of residence at University. The OTC people were getting dropped off at the hall in an army Land Rover, dressed in their OTC gear. Another supervisor, from Northern Ireland, was very angry about this claiming that they were under no circumstances allowed to do this as it makes the hall a valid target in the eyes of the IRA (or the “Real IRA” as I think were the ones doing the bombing back then).
She claimed that Army personnel were not allowed to wear their uniform in public for this reason.
Note this was also in Birmingham, which had been the target on IRA bombing in the past.
Clearly that’s dependent on circumstances, or we wouldn’t have Trooping the Colour and no end of ceremonies and parades that involve uniformed service personnel.
It may well be that, according to the official level of security alert at any given time or place, there may be local orders, or more likely advice to use common-sense (as for a few weeks after the murder of Lee Rigby) about wearing uniform when off duty.
This is actually a major theme of the most recent episode to air in the UK, “The Woman Who Lived” (the second part of “The Girl Who Died”), in which the Doctor notes that one of the reasons he travels with human companions is to remind himself that their brief “mayfly” lives matter.
Going back to Tennant’s Doctor, as mentioned already he was averse to using weapons, yet seemed to be endlessly fashioning them. At one point (possibly “The Stolen Earth”) this hypocrisy is pointed out again when he’s accused of turning people into weapons, as revealed by both Sarah Jane and Martha being willing to blow themselves (and quite a lot of other people) up to stop the Daleks. Much of NuWho has been devoted to Angsty Doctor moments about the number of beings whose deaths he’s been responsible for. It’s gotten a little tiring, to be honest.
And going back to the original question, a lot of the Doctor’s antipathy to Danny has to do with his relationship to Clara and whether Danny is “worthy” of her - note that he tries at one point to set her up with a different teacher (who bears a certain resemblance to his former self) and derisively calls Danny “PE”. The soldiering thing is tangential to the Doctor’s actual issue with him.