Yes
However they give up constitutional rights and are under the USMJ, not regular courts. So that’s the twist there.
Thankfully under the UCMJ there’s no obligation to follow unlawful orders.