Short answer:
By most human standards, most pets are "clean", but that depends on their life circumstances. Humans can be infected with bacteria and parasites, but that depends on the hygiene and immune system of the human. In general, the risk of becoming ill or sick due to a pet (in Western society) is very low, unless you grossly disregard hygiene and ingest fecal matters.
Long answer:
Pets are never free of bacteria, but neither are humans. We have beneficial bacteria living on and protecting our skin. No matter how much you brush your teeth, you'll never be able to remove every last bacterium from your mouth. Without bacteria in your gut you'd get seriously ill. The same applies to pets.
Of course gut bacteria from feces and urine make you ill. There's no big difference between human or pet feces in that regard. But just because pets cannot wipe their butt clean doesn't mean they're full of fecal bacteria. Evolution found a rather clean solution for this problem: the hair surrounding the anus of almost all mammals deflects the feces and lets them drop off cleanly. If the animal doesn't have diarrhea, you won't find any caked fecal matter on their behind. Of course the dog could come into contact with feces of other dogs or cats, depending on their lifestyle.
Pets don't bathe like humans and they don't use shower gel, so their fur accumulates some amount of sebum. Some of that is licked off again by the pet during their natural grooming behavior. Pets produce sebum at a very slow rate, so a dog that wasn't bathed for 6 months might have accumulated an amount of sebum compared to a human who washed their hair 2 days ago. This depends on the individual and their living circumstances, though. Dogs living outside all the time produce more sebum to protect against rain. Dogs living in a warm and dry home produce almost no sebum at all. I'm not aware of any health risk associated with a dog's sebum.
In addition to that, pets accumulate some dust and dirt in their fur. As long as their fur isn't caked with mud, most people still consider this "clean" and don't feel the need to wash their hands every time after petting their pet because this dirt is no different from the dust and dirt in their every-day environment. Humans who are not severely immuno-deficient, weak or already ill do not get ill from contact with pet hair and the general dust and dirt of a pet. On the contrary, contact with this every-day dirt keeps the immune system in working order (prevents allergies) and can even train the immune system to recognize pathogens in small traces before they have a chance to infect you.
The saliva of dogs is often considered "clean" because it has antibacterial properties, but it is not free of bacteria. The immune system of humans usually copes very well with the bacteria that live in/on pets. One notable exception is if the dog or cat can go outside and come in contact with trash or rodents. Only people with a weak immune system should not let a pet lick their face. Pets should not lick any wounds or rashes on a human skin. Have a look at a related question: Is it safe to let a pet lick your face?
The most common parasites of cats and dogs are either skin parasites like ticks or fleas and gut worms. Most skin parasites can infest humans as well, but ticks don't move from one host to another and several kinds of fleas are specialized in only cats or only dogs and don't infest humans. It's also rather easy to tell if a dog is infested with fleas or not and the chances of a dog being infested is rather low.
Some gut worms can also infest humans, but to do so you must come into contact with the eggs contained in fecal matter and ingest those. Cases of contamination are rare, but above zero.
As far as I'm aware of, there's no health risk involved in touching a pet's tears or mucus or other bodily fluids.
If they are so clean, then why are pets banned from most restaurants?
There are 3 main reasons why any kind of animal is banned from kitchens and most restaurants don't like pets in their facilities:
- Other guests might be allergic to the fur.
- Pets might misbehave and annoy other guests.
- A restaurant has to prepare food that's safe for any person, even ill ones and those with severe immune deficiencies. Any food scandal might be the death of a restaurant. To eliminate even the slightest risk to any customer, pets are banned from the kitchen.
Summary:
If a pet lives with a family and is cared for, there's no reason at all for you to be afraid of catching an illness. Even if someone prepares food after touching a pet, the food is usually still safe. The only big exception is contact to fecal matter.