iphone would be really difficult / impossible. The current devices are made by the manufacturers to run linux and through the wonders of GPL some source code is available. Iphone doesn't have any of that for its operating system.
Windows phones are easier, they run uefi and a few months back the signing keys were leaked.
I don't think it is impossible. There was an iphonelinux / Androidiphone project some time back. Use this as starting point. But it will be a lot harder than porting to an Android device, I think.
I did some research on that some time ago, and they had most drivers working actually, so you could really boot up an android from inside iOS, with something like kexec, and use it like it was an Android device. So if you find the kernel sources somewhere etc, it might be feasible.
(When you have that, getting it to directly boot GNU/Linux, without booting iOS first, would be the next step.)