I don't think many women would be "happy" if they were dating a guy who was living his ex. Men aren't likely to trust other men sleeping under the same roof as their girlfriend and especially if the roommates were former lovers! Whether or not exes can be roommates is unimportant if their significant others aren't happy with the arrangement.
As for the two exes, I suppose anything is possible if they have had a large enough block of time between their breakup. Going from lovers to friends overnight is unlikely. In cases like that one person secrectly is hoping for a reconciliation. They'll gladly accept the "let's be friends" offer if it means they get to stick around in some capacity.
Many years ago I had a friend who lived with a girl and their relationship ended. They both were on the lease for the 2 bedroom apartment. She began dating a new guy. One morning my friend woke up to the sounds of sex and her headboard bamming against his side of the shared bedroom wall. He later heard her laughing and playing in the shower with the guy.
The person getting dumped has a hard enough time moving on without hearing their ex have sex in the room next door!