What do you mean prevent connections? Is this an autorouter problem?
You can make a custom pad stack by placing a pad on bottom layer only, for example, then a separate unplated hole in the same place. Check that the hole is set to "No Net" and add a clearance rule allowing them to overlap in that particular circumstance (e.g. in applicable footprints). (It may help to name the holes '0' or something like that, while the pads are named as usual for association with the schematic symbol.)
Tim