The big dog in the military is the president. He can order all subordinate commanders to do his bidding. The U.S. Navy had a problem with this. Naval subordinates thought they could ignore the orders of the commander in chief.
They can not.
The Secretary of Defense just fired the Secretary of the Navy for not following orders. More subordinates will probably be relieved of their commands.