In early game, just put every abductable villager's behavior to "survivor", it makes them invulnerable. And only have un-abductable villagers (like monsters and animals) defend the base.
By midgame, it is possible to dismiss raids by putting totems that drop number of raiders below 0.
It is possible to put a base in an inaccessible location like an island, but it gets buggy and it's hard to predict what exactly would happen. Sometimes raids would just refuse to spawn. Sometimes they would stomp around your base till morning.