Yes, certainly, I’ve had this happen. Of course, many, many wet dreams as a teen and through my 20’s. I was glad when that began to stop happening so much in my 30’s, I was tired of the mess, and usually the dreams weren’t as interesting as my fantasizing when awake.
Once, I dozed off on an overnight train ride, and quickly had a wet dream. I woke just a split second too late to try and hold it off, so I was cumming a large load in my pants. They were beige colored, so there was a big stain on the front, and going down the thigh of one leg. Thankfully, it was around 2AM, so most other passengers were asleep. I made my way to the restroom, and had plenty of time to clean up, without anyone knocking on the door. But, I hated having the residue still in my pants when I arrived, and quickly got to my car and drove home from the station.
Another time, in college, I remember during a break between classes, I was reading in an empty room. I dozed off, and after not more than a few minutes, in a state of being half-asleep, I realized I was on the verge of cumming. That time I caught myself, and was able to hold it off. I was so relieved, because I probably wouldn’t have had time to go across campus to change my pants without being late for my next class.
Lots of other times I’ve been close to cumming when I’m awake and fantasizing, usually while erect, but I’ve been able to catch myself before reaching the point of no return.