A healthy respect of food safety is a good thing. That being said, I’m not aware of sourdough cultures being much of a risk.
Certainly many of us have had a new culture get contaminated with some sort of bacteria or mold when it was just starting out and had it go bad. However, I have not heard of any healthy, established cultures getting contaminated. Could you do it if you really wanted to, probably, but I think you would have to put some effort into it – deliberately contaminating the culture. If you keep your culture well fed or refrigerated and use basic sanitations techniques – just keeping anything that goes into the culture clean if nothing else – I don’t think you will have a problem. That being said, like anything in food safety, if you are in doubt, error on the side of safety!
As for a new culture, if it gets moldy or turns some strange color, or stinks, throw it away and start over. If you buy a dry culture, follow the instructions. They will tell you how to deal with minor contamination early on. It is possible (maybe likely) that it will smell bad at first. Perhaps there is a contaminant in your flour – not at all uncommon. With proper handling and care, it is usually the case that the sourdough culture will take over and kill off the contaminant and then establish itself as dominant.
Most sourdough cultures are pretty robust. The yeast and bacteria form a symbiotic relationship that not only helps feed each other, but also produces natural defenses against contamination.
If you are new to sourdough, I would encourage you to get Ed Wood’s Classic Sourdoughs book.