Every person and every company should pay their fair share of taxes and we do not advocate tax evasion or tax fraud of any kind. However, everyone has a legal right to minimize their taxes through legal tax avoidanceas well as to protect their hard earned assets. Citizens of many countries now find themselves with increasingly encroaching governments, uncontrolled government spending, rapid currency devaluation, rising taxes and unbridled litigation which are all spiraling out of control. It is a fact that as one's income and assets increase, one becomes an exponentially larger target of governments, hungry lawyers, fraudsters and generally those that do not contribute to society but rather spend their time devising strategies to extract from the "rich".
So in short, yes it is nearly always legal to utilise offshore companies, trusts, foundations, etc. for asset protection and it is very often possible to also achieve legal tax minimisation.
"No man in the country is under the smallest obligation, moral or other, so to arrange his legal relations to his business or property as to enable the Inland Revenue to put the largest possible shovel in his stores. The Inland Revenue is not slow, and quite rightly, to take every advantage which is open to it under the Taxing Statutes for the purposes of depleting the taxpayer's pocket. And the taxpayer is in like manner entitled to be astute to prevent, so far as he honestly can, the depletion of his means by the Inland Revenue"
Law Lord, Lord Clyde, (Ayrshire Pullman Motor Services v Inland Revenue
 14 Tax Case 754, at 763,764)
"There is nothing sinister in so arranging one's affairs as to keep taxes as low as possible. Everybody does so, rich or poor; all do right. Nobody owes any public duty to pay more than the law demands; taxes are enforced extractions not voluntary contributions!"
US Judge Learned Hand