Having an offshore company is in most jurisdictions not illegal. The problem is rather that there is no point owning an offshore company if you own it yourself, declare this to the authorities and are living in a high-tax jurisdiction.
You and the company will be taxed as the company were...