Are there any background walls which are immune to explosives?

Solution 1:

I'm pretty sure the answer is no. The only background walls completely impervious to anything are world-generated, unsafe walls (unless the blast reaches a hole in the wall, or an edge). However, these, by design, cannot be placed by the player at all, and in any case do not prevent monster spawns.

It looks like you're out of luck here. Bombs and Dynamite can blow up any player-placed wall.