I've read books (that have made millions of dollars) that reference nothing but real-life brands and IP. However, I know the rules behind this are much more strict when it comes to TV - although I'm not at all sure about comics.
I tend to make up fake brands and companies rather than reference any real ones (although this is also because the universe is a different one than our own). It's a way of being safe - and it's a method I've seen often in cartoons - even if the object closely resembles the original content of the franchise/etc; it's probably okay if it's important to your story or an indicator; as simply having a reference would not be enough I'd think.
Particularly when it comes to "lines." Tons of shows use lines from popular media within their own story to put an emphasis on a moment or make a joke. You can also make homages, etc.