Something like PiHole for localhost only to run on phones when away from trusted WiFi.
Check apps: blokada, dnsnet (fdroid), Adguard (the paid one, there are discounts for lifetime for as low as ~$10), I think even DDG browser used to have that.
Often they work by providing a fake vpn that is hosted from localhost and filters ads. So it can work for any app and you can cherry pick them.