Here's the skinny: wine is a living, breathing thing and is subject to flaws, just like all of us. These flaws can be both very apparent or almost undetectable, and while they may be unpleasant for some people, it's important to know that they're not harmful. Disappointing, yes... but nothing discussed below will harm you. There are gobs of potential flaws in wines, but we'll just focus on the main ones; those you're most likely to encounter - and notice - as you travel the wine trail.
First up is the one we all know... the fearsome CORK TAINT (aka TCA, 2,4,6-Trichloroanisole, 'Corked'). Cork taint is a chemical impurity that finds its way into a bottle during production usually from the cork itself (hence the name) but can also be from other steps during production: unclean barrels, tainted equipment on the production line, etc. It causes your wine to smell like wet dog, old/soaked newspaper, or wet cardboard. It can be faint, or it can overwhelm the glass to a point where you can't smell any fruit at all. Some people are more sensitive to cork taint than others, but the bottom line is that cork taint is a serious flaw that aggressive estimates predict affects nearly 2% of wines bottled under natural cork. Note: while you technically could have a "corked" wine bottled under synthetic closure - Stelvin (screwcap), synthetic cork, glass cork, etc - the likelihood of that is extremely rare, and would not just affect one bottle; it would taint an entire batch.
Next is another, very common flaw: oxidation. It's exactly what you think it might be - too much oxygen getting to the wine. This happens if the bottle's closure is faulty, or something funky happened from the time it left the winery to the time it hit your hands. While some air will allow a wine to "open up", excessive exposure will take it beyond the brink and once it hits that point there's no turning back. Oxidized wines will take on a vinegar note; whites will turn darker (usually) and lose brightness, while reds will turn a brownish color at the rim. Note: gradual oxidation is a good thing for some wines (!), and is essentially what the maturation - the natural bell curve - for all fine and rare wines is all about.
Sulfur (S) is another semi-common taint in wine, but it's something that usually will "blow off" with time and aeration. Dihydrogen sulfide (H2S) is a naturally occuring byproduct of (some) fermentations, so essentially sulfur - in some shape or form - is going to be in wine. It's the overtly aggressive form, a permutation called mercaptan, that is the one most people find offensive because it smells like rotten eggs or burnt rubber. Again, 15-30 minutes of aeration usually will alleviate this flaw, and some Somms even swear by using silver to stir the wine as the silver reacts with the sulfur to make silver sulfide, a compound much less offensive to the nose and palate!
Finally heat and light damage, more commonly known as "cooked" and "lightstrike" wines, respectively. Both of these can be easily avoided if you treat your wines with the care they all deserve. Cooked wine happens when bottles are exposed to extreme heat over an extended period of time. Lightstrike happens when bottles are left to fend for themselves against excessive UV light. Both things can be avoided if you are respectful of your wines; simply store them in a spot where the temperature is relatively consistent and is not getting crushed with direct sunlight - it's really that easy!
Again, wine flaws are a natural occurrence and are a reality of dealing with a living, breathing consumable good. If you encounter a flawed bottle at a restaurant, any Sommelier or Beverage director worth their weight will happily find you something you're happy with - they want you happy, regardless of whether the wine is truly flawed or not; BUT know that flawed wines are vastly different from wines you simply don't like or understand). And check with any merchant regarding their return policy for tainted bottles; some states simply don't allow for returns on consumable goods, some do. The reality is, sometimes (but very rarely) dealing with an imperfection is just the cost of doing business with wine - a cost most of us are more than happy to pay!