There's a danger in taking any drug that isn't purchased from a reputable source. If you buy your drugs from a pharmacy then taking a generic drug should be no more dangerous than taking its name-brand equivalent.
For most people generic drugs are a great and cheaper alternative to expensive name brands. They should have the same active ingredient, although I've read that sometimes differences in the other nonactive ingredients change the way some people respond to generic drug vs. name-brand drugs. I don't really know the details about that and I don't think it affects safety.
I don't know about OTC drugs like cold medicines, but I've always assumed that generic brands are just as safe and don't remember ever reading or hearing otherwise.
Click Here to search for a treatment center in your state that is right for you.