A sovereign parliament certainly has that ability but they choose not to exercise it, which I guess is the price we pay for capitalism.
They are trying, but it's not easy to do. It's always easier to find and exploit 'loopholes' than it is to stop them.
It also doesn't help that a decent tax barrister can earn £10,000+ an hour, which is more than a tax inspector earns in a month.
Tax avoidance by UK-only resident groups has massively decreased in the time I've been working in the industry (14 years). The problem area is international groups, which has increased as world trade becomes more globalized. This has been made even more difficult by the rise of the internet, which often makes it hard to determine exactly where operations exist.
Multi-national action is required to deal with this, and there was little appetite for that prior to 2008 because nations have been engaged in a tax bidding war against each other. When the tax base collapsed in 2008, all that changed and we are now having genuine efforts between nations to pin down the groups using treaty shopping and tax arbitrage to ensure their profits are taxed at low rates, or sometimes not taxed at all.
The next round of BEPS (Base Erosion and Profit Shifting) announcements are coming very soon, and there will be big changes to the rules on Permanent Establishments, Transfer Pricing, interest deductions from hybrid instruments, intellectual property/patent boxes and more.
Already we are seeing changes - businesses are moving to adopt Country-by-Country reporting (my employer is already preparing for it and I know others are too) even before it is mandated.
The tax environment is very different to the one I joined 14 years ago. A lot less cosy relationship with HMRC (not always a change for the better), a lot more bureaucracy, a lot more transparency, and a lot less appetite for aggressive tax planning.