Well, he is head of the executive branch which the DoD falls under. He can issue whatever order he wants. It's up to the court to decide if they are/were lawful. SOP doesn't mean a whole lot here.
SOP doesn't constrain his options, but it makes one wonder why intervention was needed if it's unusual and it occurs.
It is quite clear whether Trump's interference constituted foul play. Everyone who has been paying attention understands very well that he is motivated strongly and solely by his enmity of and hatred towards Bezos.