You might be thinking about the DMA, which adds a lot of responsibilities to "gateway" providers and platforms like Apple and iOS.
However the EU ruled many years ago on this subject (https://www.infosecurity-magazine.com/news/apple-iphone-jail...). In effect, jailbreaking and modifying software is perfectly legal, as long as it's not for copyright infringement.