"But, if his boss tries to force him to work without providing him a hard hat, he can very well say "no". Is it really that different?"
Analogies are weird things. Sometimes they work, sometimes they don't.
In this one, the construction worker can just say "No", give notice and walk off the job. Military personnel are under contracts.
Since I've never been in the military, I have absolutely no expertise in this, but from what I've gathered, the recruit signs a contract for a certain period of time, then can reinlist when the contract expires.
If the person breaks the contract, he/she can be arrested and prosecuted for the crime of desertion.
I'm way out on a limb, here, as I have only a vague idea under what terms a military service person enlists, and for how long.