The Hatch Act bars federal officials from participating in political activities while serving in their official capacity and in their federal workplace.
Generally, troops' rights are limited since vaccines are widely seen as essential for the military to carry out its missions, given that service members often eat, sleep and work in close quarters.