Unfortunately, Apple often disagrees. They have tried to make multiple frivolous lawsuits against people doing exactly this, over the years.
Sometimes it doesn't matter what your rights are, if a company is willing to spend a bunch of money trying to submit illegal lawsuits to bankrupt you.
Here you go: https://consumerist.com/2009/02/14/apple-wants-to-make-jailb...
That is a clear example of a bad actor.