You use pistons from a long distance to push blocks into the chunk before it populates.To build something with redstone and pistons you need to visit the chunk, and then visit it again later. So you are saying that dungeon generation code *always* runs, and can this retroactively place dungeons if you identify the potential spawn location and set it up to qualify on a revisit?
I need to see more info on this.
Minecraft chunks generate in two stages - in the first stage, the basic terrain is created. In the second stage, ore veins, trees, dungeons, and so on (that might span across chunks) are generated. The second stage only runs once the first stage has run for all adjacent chunks - otherwise, things like trees might be cut off on chunk borders.
For dungeons, the second stage chooses some random locations (based on the world seed and chunk position), and checks if each of them meets the prerequisites for a dungeon. If so, it generates the dungeon. It's rare for a chosen location to meet the prerequisites. The prerequisites are things like having stone in the right locations, and being connected to a cave.
It's possible to push blocks a long distance with extensive use of pistons, and push blocks into a first-stage-generated chunk. You can arrange so that all of that chunk's potential dungeon locations fulfil the prerequisites before the second stage runs. Then when the second stage runs, it generates dungeons there (because the prerequisites are met).