Constitutionally yes, but in the real world the military, and intelligence community are the first to know that America faces a danger that might require military action. They're the one's watching the big board, and anticipating the president to order a response.
In the case with Milley, if the president orders a military or nuclear strike the military and intelligence community knew didn't come from them, they wanted to ensure the president at least consulted them with the reason. So they could determine of the order was legal.