In the US, if Android side-loading were more common, we'd already have this, except that companies would require it.
In the EU, they'd probably crack down on companies that tried to do this. However, although it's technically illegal for governments to do such things, apparently most governments routinely break the anti-mass-surveillance laws.
On iOS, Apple has banned many bad actors for such shenanigans (although they still allow spyware from large companies like meta and google).