Most times you block ads with browser extensions.
PIhole is kinda a firewall in many ways. A DNS server or VPN do not filter any traffic. Both the browser extensions and pihole have lists of sites that they block. It is these lists that do all the work. A VPN site I guess could have a firewall that filtered traffic or you might find some special DNS server that also filtered.
The brute force way if you have the lists of ad sites is to just add them to the host file in the machine and point them to a dummy address.
The DNS method only works for things that use names some are using direct IP addresses. Those never do DNS lookup so you would have to block them with a firewall of some kind. Also a most DNS things do not work if you use encrypted DNS, which you should be using.
The browser extension tend to be what most people use. Unfortunately google and apple make it harder to get stuff if you are wanting to block ads on a phone.