Very much so. The U.S. military officer’s oath is significantly different from that of the ranks [key phrase highlighted].
Enlisted:
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; and that I will obey the orders of the President of the United States and the orders of the officers appointed over me, according to regulations and the Uniform Code of Military Justice. So help me God."
Commissioned Officer:
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.
There are certainly officers who’d side with the fascists (the Air Force has a serious Xtianist problem) but most of them take that oath seriously enough that they won’t just blindly follow the orders of superiors when they conflict with the Constitution.