The answer to the question of having a cat as a companion for an indoor dog is really not as simple to answer as a yes or a no. In reality there is a great deal of variation in both cats and dogs that makes some combinations ideal for both animals and some combinations terrible for one or both animals in others. Knowing a bit about both the breed traits of your dog as well as how the cat responds to dogs is going to be essential in making a good combination.
The very best option is to choose a dog breed that is a known non-aggressive type of breed. These can be either purebreds or mixed breeds, but look for dog breeds that haven't been bred to chase or hunt as a good starting point. Avoid breeds that have been selectively bred as vermin and small game hunters. This would include a fair number of the terriers as well as the sight hounds. Generally Whippets, Greyhounds, Staghounds and Borzois need to be raised with cats from puppies in order for this relationship to work. While these dogs may be a great match with a cat, there is more risk involved in socializing the two together which, if you don't have a lot of time to supervise the interaction, is going to be more problematic.
There is also a real concern with sight hounds and cats which is simply that these dogs have been bred for generations to chase. Literally they will chase anything that catches their fancy and a quickly scampering cat or kitten is certainly very similar to a rabbit, squirrel or small animal that their instincts tell them to chase. Often the companionship is fine as long as they are always in the house together and the cat is not prone to running or is able to get up or away from the dog. However, if left alone there is always the very real chance that the dog's instincts may simply take over if he or she is stressed or startled, resulting in serious injury or even death to the cat.
Surprisingly it is not always the smaller dogs that are best match for cats. Some of the large breeds that are very calm and placid are great with cats and will allow the cat to snuggle up, share the bedding and even share toys. Some breeds that are typically good with cats provided they are socialized and raised with felines include the retrievers, most of the spaniel breeds and the setters. Other dogs that are good with cats with proper training include the St. Bernard, Bernese Mountain Dog, Welsh Corgi, Shetland Sheepdog, Poodles and the Schnauzers. Small breeds that are typically good with cats include the Pomeranian, Pekingese, Pug, Bichon Frise, Lhasa Apso, Shih Tzu and the Papillon. Cavalier King Charles Spaniels, Beagles and German Shepherds can also be terrific matches for cats, as can Rottweilers and Great Danes.
If you are considering a dog and cat combination, getting them both as a puppy and a kitten is a great idea. You can, of course, also consider a rescue dog or cat that has been tested at the rescue facility for its ability to interact with the other species. As long as one of the two is used to the other species it is typically manageable, but a fully grown dog and cat that aren't other species friendly is going to be much more of a problem to develop a good companion relationship.
Always introduce the cat and the dog slowly and maintain a high level of supervision until you are certain they have adjusted. Baby gates can be used to keep the two in different rooms but still able to see and smell each other, at least until they are calm and used to each other's presence. In addition avoid spending too much time with the cat if you have a fairly possessive type of dog. Often the smaller lapdogs will become possessive of you and may become aggressive to a cat that they may see as approaching "their" person. While this is often considered jealousy it is really that the dog sees you as his or her possession that needs to be protected from the cat.
Although many cats and dogs get along well together, there are few combinations that actually play enough to provide a significant amount of exercise. Often smaller dogs and cats will play more actively together, although even the larger breeds will learn to interact in playful ways with each other. Be careful to provide a place for the smaller of the two, usually the cat, to get away from the other animal, especially in the case of a larger, rambunctious puppy. A scratch from the cat can quickly turn playtime into a serious fight in which the cat is at the greatest risk.
One very important consideration when your dog and cat are left alone indoors together is the food and water. Typically most cats aren't interested in dog food, but dogs will eat cat food with obvious enjoyment. If your dog is food possessive or possessive of his or her water dish or toys, be sure to have separate and safe areas for your cat to eat and drink away from the dog. You may also want to consider removing the "favorite" toys to prevent the dog from becoming protective or aggressive towards the cat.
Cats also tend to be much less active than dogs in general behavior. Cats typically spend as much of the day as possible curled up asleep, so they may not be interested in interacting with the dog at all. Having a cat in the house with the dog is still a good idea provided they are socialized together and safe without supervision. The cat and dog will learn to interact with each other on their own terms and they will eventually provide a great source of companionship for each other.