Is illegal behaviour same as ethical behaviour?

No. Illegal behaviour is unethical behaviour.

Ethical means to follow a code of ethics based on rules of fairness and honesty.