I don't think that you have to use Apple toolchain, it's just way way easier to do so. I think there was some linux toolchain that you can use to build binaries for iOS.
On a non-jailbroken devices you will need to sign your binary with Apple's help but on a jailbroken device you can install whatever you want. It's also perfectly legal.
Besides, some hacking companies manage to install their malware on non-jailbroken devices.