I dont believe the Hatch Act applies to military personnel.
However, Im sure something similar is probably in the UCMJ.
I know you cant politic or demonstrate in uniform.
You’re correct that the Hatch Act is incorporated in UCMJ; I was in the ARNG when adjutant generals were still elected, and it was flagrantly disregarded.
MAJ Gabbard released a vid of her wearing dress blues & announcing she was off to annual training for two weeks.
If that ain’t politicking in uniform, then I don’t know. It screams, “Look at me! I’m not like those nutbags Beto, Buttplug, and Lizzie!”