You can. You can jailbreak your iPhone. I assume you can do so with Android. Problem solved.
Oh, you want to jailbreak it and use it as an authenticator? No. That doesn't seem like a reasonable requirement.
"you can run anything you want as long as it's not what I don't want you to run" seems like an odd argument to make.
Jailbreaking iPhone doesn't let you install GNU/Linux on it.
You don't have to jailbreak some Android devices, namely the Google devices (provided you didn't buy them from a carrier).[1] They are designed to allow alternate firmware.
Instructions for installing alternate firmware : https://grapheneos.org/install/web
[1] https://grapheneos.org/faq#supported-devices