What about PRISM?
https://en.m.wikipedia.org/wiki/PRISM
Do Apple and Google have a choice to legally opt out of it?
Yes, by incorporating end-to-end encryption in their services.
What difference does that make to the outcome? If anything, being automatically subject to that without any option is worse.