The bg
argument of par
change the background color of the device not of the plot. Since you're just merely adding a plot to an already opened and used device, this is not a possibility (because of the pen-and-paper way base
plots are drawn). Instead what you can do (building on this previous answer) is the following:
plot(d0)
subplot(fun = {plot(d0_inset, mgp = c(1,0.4,0), ann = F, cex.axis=0.5);
rect(par("usr")[1],par("usr")[3],par("usr")[2],par("usr")[4],col = "blue");
points(d0_inset, col=2, pch=".") },
x = grconvertX(c(0.75,1), from='npc'),
y = grconvertY(c(0,0.25), from='npc'),
pars = list(mar = c(1.5,1.5,0,0) + 0.1), type="fig")
Edit: if you want the area containing also the annotations to be blue, the other solution i see would be to draw the rectangle prior to drawing the subplot (using the coordinates you gave to the subplot function):
plot(d0)
rect(grconvertX(0.75, from='npc'), grconvertY(0, from='npc'),
grconvertX(1, from='npc'), grconvertY(0.25, from='npc'),
col="blue", border=NA)
subplot(fun = plot(d0_inset, mgp = c(1,0.4,0), ann = F,
cex.axis=0.5,col=2, pch=".") ,
x = grconvertX(c(0.75,1), from='npc'),
y = grconvertY(c(0,0.25), from='npc'),
pars = list(mar = c(1.5,1.5,0,0) + 0.1), type="fig")