Well, as most matters on human universe have two sides
'the good and the bad', tax planning has its own good
'the tax avoidance scheme' which is perfectly legal, and
the bad 'tax evasion scheme' which is illegal in terms of
law.
From the beginning of 20th century many court cases took place
in many industrial countries (USA, Germany, UK) and as summary the
main outcome was that 'every person or a legal entity in this
planet has the right and duty to take reasonable steps to protect
their assets using legitimate ways'.
That said, for an investor, the key to exploit this right and
avoid unnecessary cost (taxes), is to pro-actively plan and assess
exposure to tax authorities. This is a recurrent process performed
every time when conditions change.