That not only should be illegal, it is. Using somebody else's trademark in a way that could decieve a customer into thinking your product is theirs is like the definition of infringement.
But from what I've seen, the vast majority of ads that incorporate a competitors trademark are not doing that, and making it very clear they are advertising an alternative to the trademark being referenced.