Aliens discover Earth but are mistaken who the real inhabitants are: i.e. the aliens think that humans are parasites or something and that the real Earthlings are cars or something else.
Is this an old joke or a real story?
UPDATE: Found it!
It sounds like you're describing a scene out of the beginning of the movie "The Hitchhiker's Guide to the Galaxy" (2005):
FORD: Remember when we met? That car was racing toward me, I was trying to greet it, you pushed me out of the way?
QUICK CUT TO A STREET - MID-DAY: Ford stands in the middle of the road, extending a hand to a fast approaching car. Arthur drops his shopping, dives at him and tackles him out of the way as the car zooms past.
FORD: Didn't you find it a little strange that I was trying to shake hands with a car?
ARTHUR: I assumed you were drunk.
FORD: (shaking his head) I thought cars were the dominant life form. I was trying to introduce myself.
(PDF of the script can be found here)
This is a specific instance of a general trope: "Mistook The Dominant Lifeform". As mentioned in the examples at the above link, the more specific cars-as-dominant-lifeform trope has cropped up in Transformer comics and Carl Sagan's book Pale Blue Dot: A Vision of the Human Future in Space (1994), but there are probably a number of other works it has appeared in as well.
There was a Donald Duck comic where Scrooge sold the "1-2-3" product, an evolving car, over the whole world:
Scrooge ended up unknowingly saving the world as aliens approached and identified the 1-2-3s as the real inhabitants of the Earth. They attacked the 1-2-3s with their shrink rays and left without harming any humans.
Probably not a story, but in Stapledon's Last and First Men, the Martians (sentient microorganisms) waged war on the earth in order to liberate diamonds from the humans, whom they first did not perceive as the source of the radio broadcasts.
The Day The Earth Stood Still (movie) loosely matches this description. The earth was going to be destroyed because the parasite humans were destroying it.
There was a book of physics jokes that I saw in the 1980s, though it was published much earlier that contained this story as one of the jokes.