These are vastly different things. You own your phone and you can do whatever you want with it. It's just that you can't use Apple's distribution channels to spread you code.
Theoretically you could bypass everything by replacing the OS, except that you can't replace the OS without yet another key that Apple isn't sharing with anyone.
People who develop apps do it everyday many times because they need to run their code on devices. You don't ask apple for permission every time you press the build button.
That does mean Apple has a nonzero amount of control over that channel, too.
Do you want to make holes? Then you buy a drill.
I'm not hating on them. I'm just advocating a realistic perspective on the situation. iOS is a walled garden. That some people (myself included) see that as a net positive doesn't make it not one.
For the rest of us, for the low low price of $100 to join the developer program plus $1000 for a Mac, we can get the ability to install software that we can build, which more-or-less precludes sideloading as an option for commercial software.
So, for all practical purposes, yes, Apple does dictate what you can install on their phone. The question is really whether you think that that's a feature or a misfeature.