technically it's not illegal, but completely immoral. Imagine if I channelled all my PAYE taxes through an offshore company, who would pay for our health system, infrastructure etc.
I'm not suggesting that is why Dropbox are moving to Ireland. I'm saying that if that was the reason as brought up by the OP then they should be aware of current events in the UK where companies like Amazon are making billions of pounds in the UK and paying virtually no tax - even though they use our roads and infrastructure to conduct their business.
Pretty simple. :)
While not illegal, it's a little bit dodgy. But it's what everyone does these days, so why not?