There are two kinds of expected disobedience to orders in the US military. One is disobeying an illegal order, such as one to shoot prisoners. The other is doing what needs to be done to accomplish the mission despite conflicting orders. The second is why military orders have a "Commander's Intent" section. If the situation on the ground is not what was expected when the order was give, officers are expected to adapt to the new situation and overcome problems. Here's Army Chief of Staff Mark Milley writing about that back in 2017.[1] That was not about the moral issue, but the operational issues when command is messed up.
Milley faced the moral issue when he was Chairman of the Joint Chiefs of Staff and Trump lost the election.
Here's the US officer's oath:
"I ___, do solemnly swear (or affirm) that I will support and defend the Constitution of the United States against all enemies, foreign and domestic; that I will bear true faith and allegiance to the same; that I take this obligation freely, without any mental reservation or purpose of evasion; and that I will well and faithfully discharge the duties of the office on which I am about to enter. So help me God."
German military oath, before Hitler:
"I swear by God this holy oath, that I want to ever loyally and sincerely serve my people and fatherland and be prepared as a brave and obedient soldier to risk my life for this oath at any time."
After Hitler:
"I swear by God this holy oath that I shall render unconditional obedience to the Leader of the German Reich and people, Adolf Hitler, supreme commander of the armed forces, and that as a brave soldier I shall at all times be prepared to give my life for this oath."
[1] https://www.army.mil/article/187293/future_warfare_requires_...