This is something I've wondered too, and I actually asked someone I lived with at univerity who was reading psychology with the intention of going in to advertising whether there was any real study into this type of effect, and he wasn't aware of any.
I can to some extent see the idea of "all publicity is good publicity" in a vacuum - in that if you remember the advert you will associate with the product - but particularly when there's a lot of competition, then giving people a negative impression from an advert can't be a good thing, can it?
Take for example, online betting. Now, it's not something I do. But if I did, I sure as hell wouldn't use bet365 due to them having adverts involving a man with a really annoying accent (I think it might be Ray Winstone but I'm not enough of a fan of the kind of things he's been in to know him) shouting at me. I dunno what site I would use, maybe I'd google it and pick the first one that wasn't bet365 even though that's probably the first name that comes into my head when I think of online betting, purely beacuse I think the company beacuse of those bloody annoying adverts. They've built up the brand recognition in me really well, but I associate the brand with something negative.