Well yeah, you have to tell your manager of course, but _they can't stop you_ from moving to another team.
Don't know about Apple or Amazon but Google/FB are like that. If you're very senior, a few months (no more than 6 no matter how senior) delay might be imposed so that you hand off your stuff, if you're less senior, a few weeks is usually enough. It is also expected (at Google, don't know about FB) that you'll stay on each team for at least a year, and that you'll wind down your obligations in an orderly fashion, which I think you'll agree is not unreasonable.
But _nobody_ will force you to do work you really don't like to do. In contrast, at most other companies it's easier to get a job _at another company_ than to move to another team.