So, you need to lay down the law here. Your husband is a background parent. :>) Meaning, he can talk to YOU about punishment, rules, etc. but he is not the one to implement them or have the final say when it comes to your daughter. That he punished her because his feelings were hurt? He needs a good dose of 'grow up dude'. No offense, as I know I'm talking about your husband here.
My second child most definitely always preferred me and made it very VERY clear. I'm married to his dad. He just would laugh about it. I would encourage my son to give daddy hugs or at the very least be polite . . . but face it, you asked a question of her and she had already answered you when HE jumped in. This is when *I* would have said "hey, I had just asked her and she said me so it's not fair to get mad at her for this. And I'm happy to take her. "
He needs to back way WAY off or this relationship will be in jeopardy. Because you badly want this to be okay and yet your warning bells are going off. She's beginning to live in a hostile environment with him. That's sad for her and very uncomfortable for her. So, you are going to have to risk your marriage and having a bit of a difficult conversation stating boundaries he is to have with your daughter in order to protect her. :>) And who knows, maybe you'll have to do the same for your shared 18 month old. He sounds a bit tyrannical and that's just not great parenting.
good luck and let us know how this is going. I'm on your side even though my advice is probably hard to hear. hugs