You don't sign away your humanity once you join the military; there are still lawful and unlawful orders.
“Can the president order these men and women to the desert to take up a position in the vicinity of an atomic bomb test? “
Yes, and it’s been done a bunch of times.