If the law is properly written, then there is no conflict between it and ethics. It is, consequently, difficult to find examples of companies being forced to make ethical but illegal decisions, with the exceptions of the practice of law and the conduct of military operations wherein subordinate officers or soldiers reject lawful orders for ethical reasons. Similarly, in the practice of law, legal requirements, for example, defending individuals or companies the lawyer sincerely believes to be guilty of heinous acts, is a part of the business, despite the ethical quandries some attorneys may face under those circumstances.
Within the business world, an example of ethics taking precedence over the law could involve activities that are legal, but which would result in harm to the environment. A company confronting that decision normally takes the opportunity to engage in business practices that are legal and profitable. Corporate officials who chose to forego such business opportunities in deference to environmental concerns, or who agreed to increase costs and decrease profits in order to find more environmentally-friendly options would be taking the ethical road over the purely legal one.
Another example of ethical but illegal behavior in the business world would involve violating confidentiality agreements in order to convey important information to the public. So-called "whistleblowers" routinely find themselves in the situation of conducting themselves ethically at the expense of laws or binding company policies. Book publishers might engage in ethical but illegal conduct by publishing a book exposing government secrets if the author was a government employee and the book includes information that the author was sworn to protect from disclosure. To some, Eric Snowden violated secrecy laws for ethical reasons.
With respect to legal but unethical business practices, some might point to the Wal-Mart Corporation, whose labor practices and policy of forcing vendors to set extremely low wholesale prices in order to have their product sold at Wal-Mart stores could qualify as legal but unethical. Because of the broad array of laws restricting many unethical business practices, one could look abroad for examples of multinational corporations engaging in activities in developing countries that would not be allowed in their own countries. The Freeport-McMoRan Corporation's mining activities in the Irian Jaya province of Indonesia (the western part of Papua New Guinea) are legal under Indonesian law, but could certainly be categorized as unethical in terms of the opposition of the native peoples to the plundering of their ancestral home.