I don't poop in my diapers very often--mainly because I wear cloth and it's a pain to clean them. It used to be much easier when we had a regular washer--you just flush the big chunks down the toilet and toss the diapers in the washer and do a long hot-water cycle and that would do the job. But we now have a "high efficiency" washer which means that, if I poop my diapers, I pretty much have to get as much of it off as possible rinsing them in the shower, THEN wash them. This is even more complicated because one of my kids still lives here, has the nose of a bloodhound, and this means that I really have to be careful from all the smells, which stink up the entire house if you aren't careful. (An aside--in a few weeks he'll be gone for eight days and I do intend to have some poopy diaper fun while he's gone and I don't have to worry about all of this).
But I do occasionally get this overwhelming desire to be messy--and when I do I put on a pair of large, nylon, white wide-crotch "granny panties" that I bought which fit snugly around the legs and hold in all of the mess. Then I'll put a pair of adult-sized baby training pants on over the panties. Then a special pair of plastic pants that use solely for this purpose (so that my other ones don't start smelling like poop). I'll then load those--always early in the morning because everyone else is asleep and that's when I have to go anyway. I'll sit in them for an hour or two, usually surfing the web (often visiting here!). Then I go to the bathroom, take off everything except the loaded panties, and sit down in the shower and have fun. I have a 2'x2' mirror that I stand up on the floor so that I can see just what a naughty pants-pooping baby I am.
Then, I empty those in the toilet, clean up in the shower, rinse out the panties and toss those into the washer. The complete act of doing this takes about two hours.
But to answer the question--if I go to bed wearing diapers and wake up having to poop, I usually don't do it in my diapers because of the problems with the clean-up (as described above). Though occasionally it just makes me so excited that I do it anyway, lay there a while, sometimes go back to sleep, wake up, get myself off then deal with the consequences.
More often, though, if I know I'm really craving a good round of messy fun, I'll just put my panties, training pants, and plastic pants near the bed, then later (usually around 4AM) I'll wake up and put this stuff on then go back to sleep. Usually by then I have to pee and do that, which makes the training pants start getting all nice and wet and warm. Then--either in bed or after I've gotten up, whenever the urge comes--that's when I'll load my panties. I'll then sit in them for a couple of hours, often I'll have a second round of having to go and will load them some more. Then it's off to the shower to have my fun and get cleaned up.