It will likely apply to a specific version of the phone’s OS. And any device that can run that version will have the capability.
More broadly, you are talking about sideloading. And yes, the code is likely already there for Apple to implement this. They are just waiting on the ruling and their day in court to oppose. It’ll be big.
It may be gated by EU initially, but it honestly won’t take long for the world to follow suit.