“according to regulations and the Uniform Code of Military Justice”
That’s the part that provides for refusal to obey an unlawful order. You disobey an order at your peril, but an unlawful order violates the UCMJ and need not be obeyed - in fact, the recipient of the order is under an affirmative duty to disobey it.
Unfortunately, sometimes the line between lawful and unlawful isn’t a bright one.
Colonel, USAFR
I have a very good friend that is a retired Army Colonel and he thinks that only about half the military would refuse an order to attack US citizens. If that is the case, we will have them outnumbered!
True enough, but back in '72 I was at an official briefing on Guam where an Air Force BG said "I cannot imagine I would ever be given an unlawful order by my superiors." So the theory might lack something in practice.