Side note: the opposite of cat isn't actually dog. The opposite of cat is goldfish. A goldfish loves water, is not fluffy, doesn't exterminate every bird for sport, will never knock your favorite coffee mug off your desk, not bipolar, and I'm not allergic to them.
will never knock your favorite coffee mug off your desk,
I once shared a house with someone who had a fish that would thrash around in its tank so violently it would knock things off the cabinet it was on and get water all over the floor (I had no involvement in the care of the fish, but I think its tank was too small).
...when i was in second grade i wrote a book report on chocolate fever, in which the climax involved the protagonist taking vanilla pills, which were so obviously the opposite of chocolate to my eight-year-old perspective, but which no adults with whom i discussed the book found at all obvious...
I seem to remember a youtube video from years ago explaining how things can be opposites in different ways, like glue is the opposite of scissors because of the use, red is the opposite of blue because of what they represent, etc.
The wiki article lists a few categories like gradable words that exist on a spectrum (hot/cold), complementary or binary pairs with no spectrum (entrance/exit, moral/immoral), and relational types that only make sense in a certain context (teacher/student).
In no logical way does cat being the opposite of dog make sense. It's just a typical association because there was always a stronger cat vs dog stereotype in media as I was growing up. I learned that cats and dogs don't get along, are mortal enemies, etc. This of course isn't true, but it's overly portrayed in media that way.
Humans (like most living things) like to put things in boxes to make navigating their environment simpler. Temperatures aren't really opposites because they're on a continuum, but we talk about hot and cold as opposites to bring order to environmental navigation. The same with presence and absence of light and bright/dark. So, extending this logic, the opposite of cat is the absence of cat, but that doesn't really make sense. If you cut a cat in half, are you halfway on a continuum from cat to the opposite of cat? If the cat is whole but has died, is it cat, opposite of cat, something else entirely? I have no idea, and no one else really does either. Brains are weird.