Any rule or law that is ultimately immoral must be disobeyed. The Nazi laws of euthanasia, racism and institutionalized murder and genocide are the most extreme examples. Contemporary examples include the tragic case of that woman who was disconnected from her feeding tube in Florida, a number of years back. That, simply put, was murder. Judaism allows the withholding of medical care, if the quality of life would be too painful or difficult. Withholding food, however, is murder through starvation. Any form of doctor assisted suicide is outside acceptable practice.
In some cases, a strong sense of personal ethics and courage is required. A soldier given an order that, to his ethical standards, is immoral, must be prepared to suffer the consequences of disobeying. In a most extreme case, a person may not save their own life by agreeing to kill someone else. Say our sages, "What makes you think that your blood is any redder?."
Confusion comes when an order is against one's philosophy or politics, but not one's ethics. Jewish soldiers who do not believe in building Jewish towns in formerly Jordanian areas sometimes refuse to serve in those areas. I believe that is wrong. Protecting people with whom you disagree politically is no violation of any ethical standard. What this type of refusal does is create chaos. An army is charged with defending the citizens of the state. It is not to be a political battleground. Especially considering the high ethical standards of the Israel Defense forces, any soldier should have complete ease of conscience.
All of this raises the critical question of what are ethics, and what are opinions. Is there a concrete list?
Judaism emphatically says yes. The Torah is our guidebook of ethics. It is not, as is often misunderstood, a book dealing with rituals and theology exclusively. Extensive rules of business ethics, societal ethics and interpersonal relationships are interwoven throughout.
Therefore, for example, one cannot say, "I cannot kill anybody." There are situations when killing someone is the only moral choice. Specifically, defending against attackers, or saving others who are under violent assault, may often require killing the pursuer. To not do so is unethical and immoral! "Thou shalt not stand idly by as your brother's blood is spilled." Of course, we pray that such situations never arise.
Ethics are not a matter of personal choice. Rather, the choice is whether to live and choose ethically, or opportunistically. We must recognize that not every human being behaves ethically all the time. No human being is the all-perfect source of ethics. Again, as an extreme, the German soldier of World War II could not claim that the evil dictator of Germany was the ultimate source of all ethics. Even though German propaganda said that, it is a denial of God as the ultimate source of ethics.
Even people who are highly ethical, and highly respected, are not to be mistaken for God. The greatest Jewish scholars and Torah teachers never claim to be sources of ethics. Instead, they are teachers of God's ethics. In a subtle, but powerful, nuance, sages are not referred to as "wise men." Instead, they are called "wise students." Students, because they themselves must study the ethics of Torah in order to teach it. The ultimate source must always be God. Not a politician, media guru, radio personality or movie star.