Cats that are kept indoors all the time are much less likely to get any kind of parasite, but it's not impossible - they can still get fleas at least, but it's easy to treat them with products like Frontline that you get from the vet. Every puppy and kitten born anywhere has worms, but those can be treated as well. And every pet should be on preventative for heartworm, intestinal parasites, flea and tick, etc.
Cats that are kept inside are much less likely to get hurt the way outdoor cats can get hurt - animal fights, hit by car, etc. So hopefully that keeps medical costs down. Costs for vaccines is about the same, dogs need yearly heartworm testing and meds while cats don't, and spaying/neutering for cats is generally less also. Cats also keep themselves very clean, but for dogs it might just mean a bath once a month. Depending on what kind of dog you get, some need to see the groomer on a regular basis for baths and trims - another expense. You do need to deal with the cat box though.
Kittens can be adopted from a shelter for a small donation fee or even found in the paper being given away for free. Same thing with some puppies, while a purebred pup from a legit breeder could set you back several hundred dollars. If you need to do obedience classes for the puppy, that costs money too. Unless you get a tiny dog, cats eat less.
In terms of safety, it really just depends on the animal. Dog or cat, you want one that is used to people, is friendly, and has been gently handled by humans from day 1. If you visit a shelter, you may see many adult animals that need a good home but you will have a better idea of their temperment and personality. Shelter staff are generally very good at matching families with a pet that they think would be a good fit. And you would be potentially saving that animal's life. Many full-grown pets can adjust very well to living in a new home.
DO NOT get any pet from a pet store! The puppies in pet stores all come from puppy mills - horrible places that are more like puppy factories that care only about profit, not for the animals' welfare. The puppies often end up with tons of health issues which can be quite expensive to treat and as much as one might feel bad for the puppies and think they are "rescuing" them, buying one from the pet store only keeps the puppy mills in business. It's the puppy's mother that needs rescuing.
Overall, a cat would probably be less expensive, but remember that every pet needs medical care, every pet gets sick, and it will need to be taken care of. Preventative measures, like vaccines, check-ups, heartworm meds, and spaying/neutering will help more expensive things from happening, but "there's no such thing as a free pet!"