The problem here, as many have already pointed out, has little to do with the dog itself, and much to do with the ex-boyfriend how he treats you/listens to you/respects your home. He's an ex for a reason and perhaps you need a bit of distance from him. I don't know your details, etc, but I have personally found, and through witnessing and speaking to friends found, while yes friendships among ex's can happen, its actually best if there are two things that happen:
1. Total separation for a period. Unfriend on Facebook, delete old texts and emails, take his phone number out of your phone, and have zero contact for 3-6+ months. It might mean turning down parties for a while, and avoiding clubs or other common interests, but its good to expand to different social circles and different activities.
2. When you re-establish friendship, maintain healthy boundaries and don't fall into old patterns. Having done step 1 this is easier, because you now have expanded and grown socially and emotionally, so you can set new friend relationship expectations and behaviors.