That said a better router is usually worth it, I like my Netgear Nighthawk because I'm a bit lazy, someone else probably has a better suggestion.
This is totally right, and that is how I have my network configured. I have a firewall behind a dumb cable modem, and I set the DNS server for the network on that device. When machines configure w/ DHCP, they get assigned the router's address for dns resolution, which then delegates to the pi-hole. That's all specific to my hardware though.
Depending on the details, it can go from plugging your fibre directly into a small factor PC, to not being able to do it because even bridging is not available on the box and everything is proprietary.
I for instance replaced the shitty Livebox 3 from my French provider Orange with a PC running Debian. Before that it was a Ubiquity Edge Router 4.
Orange make it difficult to change the device, but not impossible. I would love them to just provide my IP though a standard authenticated DHCP request.
If you don't want to do that and keep their gateway, I'd expect you can run pi-hole anyway, and if you're not getting the behavior you want (e.g., the gateway seems to be intercepting dns or something), you can try DNS-over-HTTPS.