That argument is always trotted out, but its facile. Oddly enough Costa, Cafe Nero and Pret A Manger also provide employment and contribute income tax, national insurance, business rates, but they pay corporation tax too.
Yes of course its legal, simply because its impossible to prove that tax evasion is the motive behind loading on artificial costs such as licensing so that all your subsidiaries make accounting loses and the licensing fees (aka the real profits) are channelled through Ireland