My guess the distance would probably depend on the pollinators.
The plants I grow are only separated by about 12-15 feet , because they are both in the herb bed.
I would guess if one was diligent enough to dead head the fennel before it blooms you should have good dill seed.
The caterpillars only eat the stems and leaves so it shouldn't effect them in any way to remove the flowers.