Exactly.
As long as you don't need something like mail.example.com to point somewhere else.
I have a subdomain for my home stuff (so jellyfin.h.example.com and h.example.com is the wildcard) so that any other subdomains are still usable for internet things.
Only thing is, Pihole doesn't have it in the UI. It's widely requested, so I'm sure it will come soon™
If you are happy SSHing in, tweaking some files, then it's doable.
https://hetzbiz.cloud/2022/03/04/wildcard-dns-in-pihole/
Edit: I actually use my router as my DNS, with its DNS set to be the pihole. My router can do wildcard DNS overrides. However, I do lose insights from the pihole metrics: all requests are from 10.0.0.1