If you cannot install a native program you wrote for the device without hacking the firmware on the device, you do not have a 'real' operating system. I mean, of course you have an operating system, it's just one that Apple, Microsoft, or Google controls in the strict sense what you can do with it.
You can do that on iOS, insofar as you can attach any arbitrary iOS (or tvOS, or watchOS) device to Xcode running on a Mac, and pressing Run in Xcode will launch the "native program" you wrote on the iOS device (and keep it installed afterward.)
It's distributing binaries to others that's the hard part of these mobile ecosystems. Running your own code on your own device has never been restricted.