On the occasions when everyone has to be inside, my stallion and my mares are stabled together. I do put pregnant mares or a gelding next to the stallion, and there are no issues. I've never tolerated a stallion acting up around the mares in the barn so that probably has something to do with it, but I have fewer problems when they are in the barn that when they are out on pasture.
Keeping stallions is all about logistics. I'm always cognizant of the fact that he IS a stallion and I do what it takes to keep peace in the barn.