Slowly and carefully. Strange cats can trigger prey drive even in dogs that are good with a familiar cat. My dog lives with three cats and is perfectly safe with them, but she reacts to other outside cats the same way she reacts to squirrels.
Start out with the dog on a leash and the cat loose (if you try to hold her she may shred your arms if she gets really scared, and being confined may make her feel like she can't get away if she needs to). Make sure there are plenty of high places the cat can go to feel safe if she needs to. Don't let the dog corner her.
Use treats to reward the dog for staying calm. If both animals are calm, let them sniff each other. Don't leave them alone together right away. Supervise all interactions until you are sure your dog knows that the cat is part of his/her pack and NOT dinner. The age of the cat will also play a big part in whether the two eventually get along. An older cat who is familiar with dogs may learn to get along, an older cat who is unfamiliar with dogs may never be completely comfortable.
Dr. Seuss~DLH (brother's cat)~June 2007-
Misty~DSH (my cat & Mooby's mom)-?- Sept. 15, 2014
MooBoots(Mooby) ~ DMH(Mom's cat)~July 21, 2008-
Sunshine~ Golden retriever X white german sheperd (Dad's dog)~October 24, 2008-