As far as I know, I've never been caught during an erotic scene. It probably wouldn't be a big deal if I did, unless it were loli or something. Basically all my friends and direct family knows that I like hentai ("came out of the closet" to parents and older brother when I was drunk lol). If they walked in on an average h-scene, or even a weird fetish scene (which I don't do much of), they'd either tease me or it'd just be a bit awkward, but nothing big. If it were loli, it would be incredibly awkward, and I'd try to avoid conversation regarding it or try to get things sorted with them. I doubt my parents would be hard on me though, they're pretty cool. A few of my IRL "otaku" friends know that I like loli, so it wouldn't be as awkward with them.
I do still keep many precautions to prevent such incidents from happening though. Usually I go into window mode during an erotic scene, unless it's late night or I'm really into it. I try to find a way of minimizing the window when in full screen, and will stay full screen during erotic scenes if I do find a way (eg. Saya no Uta, press ctrl+f then start+d, does window mode then show desktop, epic shutdown). I usually play eroge at night though, so I'm usually in the clear.