The main purpose of configuring volumes for your Pi-hole container is to persist data across container re-creations and upgrading Pi-hole from a new image.
The recommended way to transfer your Pi-hole's configuration to another installation would still be via Pi-hole's Teleporter.
That's not to say that manually moving files to the volume mount locations wouldn't work, but you'd have to know which and how settings in pihole
would impact those in dnsmasq.d
in order to avoid irregularities when copying only partial information, and you also could run into permission issues, especially when trying to repurpose existing directories.