I think it's a comfort behavior also. (Just be glad she's not fondling her privates, like little boys sometimes do for comfort.)
I'd try to give her an alternate comfort thing, such as a really tactile toy, to hold and fondle and tweak. It's tough, I know, to watch a toddler do stuff like that, and keep one's thoughts level and not rush to fears that it is all about sex or whatever. But it really just sounds like it is just a habit or tic, to which the less adult attention paid the better if you don't want to nail it in. Tell your husband to stop with the yuk-yuk jokes that they will fall off and the threats that the other kids won't like her.
One woman on this site wrote about obsessively rubbing her upper lip to self-soothe, as a little child. My son finds a skin tag on the inside of my arm and tweaks and rubs it when I'm cuddling him. (Boy, does that bug me. It's no fun having your skin tag pulled on!) Like with any other mannerism or behavior we want our kids to stop doing (like speech repetitions or drawing out vowels oddly) the usual advice is to not react to it, because reacting will just make the kid more anxious rather than less.
I did see the other day the interesting advice that the only way to break a bad habit is to create a new habit, and if that is so, the corollary would be that it has to be a more appealing habit than the old one. So the toy would have to be really tactile and interesting to work as a substitute for her nipples, which are always handy. Maybe you could come up with something like her rubbing the inside of her wrist, instead, and then ask her (when she's home with you and you notice her doing it) in a mild, almost disinterested voice "Would you mind rubbing your wrist instead, honey?" It might work.
Good luck!
Has your daughter been breast fed?