If they are older or you have had the first pet for a long time then you will have to introduce the new pet gradually and under close supervision.
Keep the new pet behind a closed door so that the two can become acquainted by smell and sound first. Exchange their bedding or allow eye contact through a gauze door if possible. After a few days allow them a short time together while you are present. If all goes well increase the time they spend together.
Your cat will often show who's boss with a swipe to an eager nose so watch that this doesn't get out of hand. Most cats will run away afterward and the dog will learnt some respect...
Pets are like children. Try not to pay too much attention to one pet or encourage competition. Share the love and make sure that both pets know what the rules are for getting attention – being calm and sitting patiently.
See this great site for other fabulous hints on keeping pets:
Pets in the City