Yes, it could be installed on any phone, but it would be useless on any other phone. And in order to modify it to work on other phones (even with source code) you'd need Apple's keys.
Once the backdoor/exploit is created and released, there's no securing it to where it will only be used on a single phone.
To put it another way – if it were in fact easy to patch memory at runtime, there would be no need for the jailbreak community to spend huge amounts of time and effort every new OS release.
See https://en.wikipedia.org/wiki/SHSH_blob, https://www.theiphonewiki.com/wiki/SHSH, http://www.saurik.com/id/12
Like I said that might be for 5c and older or I might have completely invented that.
Every update is signed specifically to the device being updated.