Ninjaed by PatrikLundell, but more info...
No, it can't interfere with them spawning, but magma sea will spawn beneath your lowest cavern layer, so the rest of your caverns should be above it.
If your distances are set to minimum and your world is flat, then they are more or less much perfectly obeyed: 5 till caverns, 1 layer between each and magma sea, each cavern height 5z so total distance to magma sea with 3 caverns: 23z. Though in bit different conditions you can get odd shearing effects where there is merely floor between caverns 1-4 and ceiling - which will leave holes with tree cutting; I've also seen situations where the lowest cavern is flooded, and only a floor separates it from magma, which could be fun to experience.
However, worlds generally are not perfectly flat. This generally results in game adding extra stone layers as buffers, as well as different levels of bottom & SMR end for different embark tiles. In long-ago versions of the game, the buffer wasn't enough, and in large splits you could get magma sea and HFS to be adjacent to cavern of a different region.
These days, you merely get up to 100z tall caverns.
If you generated a world with 3 caverns, then missing them when digging down isn't uncommon; rather practically guaranteed to miss some when digging down at the corners of embark tiles, such as in the center of 4x4 embark. Centers of embark tiles are much more likely to pierce a cavern, through guaranteed if your caverns have tall pillars due worldgen passage density and openness values.