Slavery has been abolished in Islam many many years ago. And Islam has came to liberate humans from submission to everybody other than Almithty (one of the meanings of Islam is submission, It means submission to Allah). But, due to some special situation in the beginning of Islam arrival, slavery was not abolished immediately. In other words Islam created rules which closed the doors and common ways to getting slaved and opened many brilliant ways to liberating slaves which finally lead to abolishment of slavery.
It is really strange to ask about slavery rules at the moment, but if your question is related to those ancient ages in which slavery was permitted and a common thing, the answer is that:
No women and girls whether they were married or unmarried were permitted to have sex with their male slaves. In other words:
If a woman was married, according to Islam Sharia, she was not permitted to marry or have sex with other male whether he was her male slave or her husbands male slave or EVEN an ORDINARY FREE MALE whether her husband finds it ok or not. (This rule still remains in Islam today with the difference that there is no slave today)
If a woman or girl was unmarried and had male slaves, she still had not the permission to have sex with her male slave , but she was permitted to marry him ONLY on the condition that
1) She liberate her male slave
AND
2) if he also had became Muslim (since Muslim women cannot marry non-Muslim men).
If these requirements were met, she was permitted to have sex with him.
The most famous story which is similar to what you have asked is Zuleikha and Yusuf(Joseph) story.
Yusuf was her husband's slave but they couldn't have sex.