All the pihole does is intercept requests before they go to external DNS only if the request is to an item that shows up on the blacklist. Imagine that you want to load up some site.
What actually happens is that your computer sends a runner to Google's DNS (or someone else's) who tells you that the address of pornhub is actually 234.86.52.108 (because pornhub.com isn't something a router understands) so now your computer knows to actually contact 234.86.52.108 to load all the assets to your browser. What pihole does is sit between your computer and Google's DNS and forwards the request to Google's DNS only if the URL didn't match with anything in the black list. Imagine your mom checking the message the runner is bringing to Google's DNS, she sees the request for pornhub, kills the runner and buries their body in the backyard and sends back the message (uh this site doesn't exist, sincerely Google, p.s don't check the ditch in the backyard and go do your homework)
The static IP v dynamic IP has zero impact to hacking.