This will not work. You can run the DoH client locally on your Pi, as you note, but the only device using that DoH address will be the Pi-Hole. All the network clients query Pi-Hole, which in turn queries your DoH resolver and returns the answer to the client.
If you try to have Firefox query the DoH resolver directly, this bypasses Pi-Hole and you'll be seeing ads again.
Additionally, the 127.0.0.1 IP address is the internal loopback address on the Pi, and is not visible to your Firefox browser.
Correct setup: client > Pi-Hole > DoH server > Pi-Hole > client
Incorrect setup: client > DoH server > client.