Some accidents have happened in the past. Henry Cavill menton getting an
erection during a sex scene and he did apologize for it. The question from one of the posters was it possible he could have gotten one. The answer is Yes, but not likely since it's such an unsexy environment. But it can happen.
I do remember one actor saying in interview that he made a comment to his partner in a sex scene to not get offended if he doesn't get an erection and apologized in advanced if he got one. Something to that effect. I forgot the actor who said that, but it came to mind. Funny as hell.