Pi-Hole specifically has a limited number of officially supported OSes - https://docs.pi-hole.net/main/prerequisites/. PfSense/Opnsense run on top of FreeBSD which is not supported by Pi-Hole.
I assume this is true of pfSense, but Opnsense has a number of available DNS server options built into the distribution.
Pi-hole is a little easier for someone who's not into networking to deploy. I would give a beginner Pi-hole much sooner than I would introduce them to OPNsense. (I run both, OPNsense for my studio network, and Pi-hole + Asuswrt-merlin for my homelab)
I installed pihole once. Not a fan. Since then I've been using Adguard Home. It's a single go binary so it would work fine on pfsense/opnsense either directly or in a jail.
I assume this is true of pfSense, but Opnsense has a number of available DNS server options built into the distribution.