They don't depend on them. Apple would still profit nicely (albeit less) without these subsidies.
But then again the same thing could be say of various players on various industries. Detroit was, too, a city built thanks to a lot of subsidies and tax breaks; oil companies extract tremendous profits thanks to subsidies, tax breaks and all kinds of government help... so on and so forth.
Aside from that, I don't think there's a question to be raised about the legality of Apple tax scheme. There's a question to be raised about it's fairness, sure, but not the legality. Apple is using the same loopholes any other corporation can exploit (and they all do, to the extent they can or know how to).
What we need is updated international and national tax codes that start taking these things into account. Most of the current legislation was designed for a time much simpler and with less access to global markets and manufacturing chains.