Okay as a former Army Officer (Military Police) I think I can speak with some authority on the enlistment oath and "Illegal Orders".
The oath states to "Protect and Defend the Constitution of the United States against all enemies, Foreign and Domestic. To obey the orders of the President and the officers appointed over me....."
Both houses of congress passed HJ Res 114 The Iraq War Resolution (296 members from the House of Representatives voted Aye along with 77 Senators). In fact there was a even a court case, Doe vs. Bush. The case was first dismissed on February 24th, 2003 by US District Court Judge Joseph Tauro. It was appealed to the US Court of Appeals for the First Circuit. On March 13th, a three-judge panel affirmed the decision to dismiss the complaint. Judge Lynch wrote:
An extreme case might arise, for example, if Congress gave absolute discretion to the President to start a war at his or her will... Plaintiffs' objection to the October Resolution does not, of course, involve any such claim. Nor does it involve a situation where the President acts without any apparent congressional authorization, or against congressional opposition... To the contrary, Congress has been deeply involved in significant debate, activity, and authorization connected to our relations with Iraq for over a decade, under three different presidents of both major political parties, and during periods when each party has controlled Congress.
Lynch concluded that the Judiciary could not intervene, because there was not a fully developed conflict between the President and Congress at that time. On March 17th, the plaintiffs filed for a rehearing. Their petition was denied the next day.
Sorry, if Congress authorizes it, the president signs it and even the courts agree, it's legal. You can stomp your feet, hold your breath until you turn blue and throw a hissy-fit tantrum, but no matter how many times you say it, it doesn't make it illegal. If you refuse to obey those orders you are refusing to obey a lawful order and will be prosecuted under the UCMJ.
Illegal orders are those orders in violation of the UCMJ or other US Laws (including treaties we've signed).
Yes, you pretty much have to go where-ever they send you and do whatever they ask you to do. Yes, you can put in your contract what training, duty station and special schools you want, but all enlistment contracts have the "needs of the Armed Services come first" clause in them. Illegal orders are ones like "Go shoot those Prisoners", "Steal that stuff from those Local Nationals", or "We're going to stage a coup, your job is to_________." Go and invade Iraq because Congress, The President and courts say to is a Legal order.
Now as far as CO's go. I've seen it happen first hand. Had an MP in my platoon back in '88-89. Good soldier, wanted to do his time, earn some college credits/ get his Assoc Degree in Criminal Justice, go back to his hometown and become a Cop/Deputy/Trooper and live happily ever after. He "got religion" and "figured out" that he couldn't be a soldier anymore (or a cop for that matter). Went through the CO process (took about 4-5 months) and he got out. Last I had heard he was a missionary in South or Central America.
Once you enlist (or accept a commission) you don't get to pick and choose what wars you want to fight.