"Legal" means in according to the actual laws of the country. "Ethical" means according to standards of right and wrong that have some basis other than the law.
Only a lawyer or an ethicist can say for sure. However, I would suggest this.
In forty-five states of the fifty United States, it is illegal for a doctor to assist a patient to commit suicide. In those states, a doctor who helped a patient commit suicide might be acting ethically, but illegally.
In the United States, under current law, most stockbrokers and financial advisors are legally allowed to recommend mutual fund A to a client, even if there is every reason to think mutual fund B is better for that client. That's legal, but in my opinion it's unethical, because it is lying, and lying is unethical.