"Fighting like cats and dogs." This phrase has stood the test of time and is even now pulled out when things get really ugly. But do all dogs hate cats and cats hate dogs? Nope, lots of dogs love cats and maybe even a few cats who like their dogs. Several points factor into a work or not work scenario.
First is temperament; does the dog have high prey drive? Triggered by motion? Come from hunting heritage where it was there job to hunt down the critters?
The best age is young to do any introductions; both for the dog and the cat. It is not always the dog who is the bad one in a dog/cat relationship. Often the dog would love nothing more than a good snuggle but the cat has other plans like ripping the dogs face off.
Past experience is huge; my dogs have never been around cats, we have two very allergic family members so cats have never been a part of our family. Intrigue is high when they do see a cat and big desire to chase.
Behavior also factors in; many dogs live with cats very nicely in their own home but put the cat outside and everything changes. Many cats learn how to act accordingly around dogs by walking slowly; they know if they run they will be chased.
It always amazes how domesticated some dogs are; no drive to chase, they love every other animal from baby chicks to bunnies. If dogs are familiar with cats and living with them it can work out very nicely. They learn each others different behaviors and coexist; happily. With others it may take a bit of time and a great deal of work to teach them that living together can work. And then there are the times when it is just not going to work or just not wise.
I have heard of many cats losing the fight when people have pushed the living arrangements. Some dogs should just never be trusted around cats. Alongside tenacious terriers can be the toughest to provide a safe habitat for cats. They may seem just fine until the cat runs kicking in the "prey" mode of a genetically predisposed chaser.
The bottom line is to know your breed, more specifically know your dog before adding a cat to the mix. When you do add a cat, either add a kitten or cat who is accustom to dogs or can learn to live with dogs. It can be a sad life for a cat to live their life in fear. When it does work out it can be a beautiful thing.