The military may well be on our side, even if Trump decides to schedule-F all the top brass and replace them with loyalists, the officers that follow them are likely to have differing opinions of what constitutes a legal order.
From the top of the GOP down, Trump is a useful idiot, but difficult to handle. As I noted on NCD ( Sorry about the dumb link ) Trump is actually eager to nuke the snot out of someone, unable to regard the consequences. (He may be unable to consider the consequences, but I can't make that assessment.) It's going to be up to the commanders down the chain to find a way to ignore those orders, or delay them until someone up the chain of command comes to their senses.
That said, I suspect they might run out of patience, especially if they're sent to attack Americans (we're still wary after the anti-riot deployments during the civil rights movement). While I can't expect US armed forces to take sides in a civil war, they can certainly intervene to stop smaller military units from engaging.