I've done it several times with the same cat and at different dogs (and at this point I should point out that I foster and have collected a few dogs of my own over the years. I don't keep killing them or anything untoward like that
)
Whether it works out depends on the individual dog and cat. My terrier (ex poundie) has a massive prey drive. He actually tried to climb down the sea wall a few days go going after something that ran into there 
My cat was a massive interest to him when he first arrived. We managed to train him to leave the cat when he was in the house. As another poster said outside the house the cat is still on the menu
We then had a Whippet pup dumped on us, who adores the cat and is regularly found curled up with him.
After that we took in a JRT from a family who needed him gone quicker than they could find rescue space, despite never having clapped eyes on a cat in his life he was fine and totally ignored the cat.
After this we had a 'cat friendly' Greyhound. She never harmed the cat at first but she would bark at it a lot unfortunately the barking rekindled the terriers interest in the cat. When the terrier went for the cat, the grey joined in. Luckily the cat escaped unscathed. He moved out for a while and then came home but lived upstairs. After a few months I managed to persuade him to move back downstairs and retrained the terrier to ignore him.
We now have a lurcher, who is interested in the cat, but not so much that he cannot be called away/distracted from the cat. He is the same colour as the Greyhound who attacked him and the cat will not walk into the same room as him. However he has not left home again and will come downstairs, he just makes sure the lurcher is out of sight before he enters the room.
My cat has been around various dogs since kittenhood and is fairly confident with them so long as they are not large, black sighthounds.
A decent rescue will make sure you get a dog who will ignore your cat and will be willing to work through the introductions and any problems that might arise with it. Even dogs raised with cats can one decide the cat looks tasty, so they must never be left unsupervised together.