A little while ago I was playing Dance Dance Revolution and finally managed to make it through the most intense song I'm currently capable of without dying. That is, running out of health meter in the game. But I also didn't die physically. I wear a heart monitor while playing and at the end it showed 203 BPM. My age at that moment (it's about a month ago) was 30. My maximum heart rate "should" have been 190. How come I'm alive?
About a year and 4/5 months ago (end of 2014, start 2015) I did quite a bit of cardio to lose weight. When jogging my heart rate would typically float around 175. About the same when swimming. I then picked up an interest in weightlifting and soon getting stronger was all that was on my mind and the cardio went largely out the window. Having cultivated a nice layer of fat from eating for muscle gain I've started a caloric deficit and gradually increased cardio again since about a month ago. I fully expected it to kick my butt after sitting on it when not lifting for most of a year, but instead I immediately destroyed my fastest time for a 1 km swim on the first session. And surprisingly, my heart rate would stay lower for what felt like the same intensity as a year prior. Getting it to 175 and keeping it there extensively, like before, now requires a lot more effort, to the point where I don't feel it's worth it if I wanna get any distance. I'm mostly sitting at around 162 now for what feels like sufficient intensity.
I'm only one data point, but it does show two things. It is in fact possible to push the heart rate into what would be deemed a "dangerous" zone, at least for short bursts, without dropping dead on the spot. And your age alone is a poor indicator for relating heart rate to intensity. A year of getting stronger, momentarily increasing blood pressure (dramatically) using the valsalva maneuver on lifts, increased lean body mass and more has left me in a state where the same effort now requires a lower heart rate.
The "220 - age in years" formula is the most common one encountered. It was, most likely, devised by doctors William Haskell and Samuel Fox. Rather than being the result of a study by them, it was actually the result of a meta-analysis of 11 other investigations. It wasn't intended to be used as a serious guideline for exercise or training but rather an observation on the trend line through data points. Studies revealed a large inherent error of 7 to 11 BPM. However, the simplicity of the formula and it being quoted led to it increasingly being used, with the result that it is now considered the standard and general knowledge, reinforced by being plastered on cardio equipment and touted by doctors.
With all due respect to the medical profession, but despite their long training not all doctors can be expected to excel in it. They too get taught things by others, have to accept some of it as axioms and not all of them are critical enough to question everything presented, or will have the time or ambition to study further into every piece of info they must provide to their patients. A doctor is mostly concerned with you not keeling over and dying, not necessarily with allowing you to possibly compromise your health for the sake of excellence in sports performance or possibly get some benefits from optimizing your heart rate during cardio exercise. They want what works for most, and the 220 - age recommendation seems a safe one.
Many other formulas have cropped up, and a list is available on Wikipedia: https://en.wikipedia.org/wiki/Heart_rate#Maximum_heart_rate. Of interest is the graph showing their differences. While it may not seem spectacular, note how some are purely linear and others follow a curve, and the difference between extremes exceeds 10 BPM.
Even so all of these are based on age. With only that one piece of info to go on, not even weight or body fat percentage or sex, this can only be so useful. There will be vast individual differences. How long have you been exercising? Which intensity? Have you done strength development? What's your lung capacity? How adapted is your body to oxidative stress and how much efficiency has been gained in the metabolic cycles providing energy? The heart itself is subject to hypertrophy under increasing demands.
So with the formulas themselves being substantially unreliable, who's to say what constitutes "dangerous" or would have adverse effects in the long term? A search for "heart rate exercise" on PubMed Central yields 82000+ results. You can find studies that draw some scary conclusions regarding possible adverse structural changes to the cardiovascular system as a result of frequent physical activity (both short intense bouts and endurance). There's studies that expound the benefits for cardiovascular health.
This one looks into the accuracy of several formulas with regards to overweight individuals: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3081386/ (Maximal Heart Rate Prediction in Adults that are Overweight or Obese, Shawn C. Frackowiak et al., J Strength Cond Res. 2011 May; 25(5): 1407–1412). There are significant flaws depending on age group and the level of obesity. The Tanaka et al. equation (208 − 0.7 × age) performed best. But looking at figure 1 I'd still say measurements are all over the shop and individual differences are significant enough not to rely on blanket equations.
Searching for information regarding dangers of training in different percentage zones of these proposed maximum heart rates yields mostly articles greedily jumping onto several studies of the past few years that show excessively much or intense exercise can have adverse effects. These then twist the tentative conclusions of the studies (based on marathon running) to state that "doing cardio might be bad for you" because headlines confirming people's desire for laziness to be the key to a healthy life sell. If you read an article starting with something along the lines of "(a) new study/studies show(s) that" and doesn't reference said study anywhere, close it.
In other words, I can't find any decent consensus on whether training close to 100% of the calculated max heart rate is in fact dangerous on the short or long term (in the absence of pre-existing conditions) and that calculated max itself is very sketchy.
If you want my opinion? Trust your body's feedback. The many hundred millions of years of evolution that led up to it have given it some pretty damn good tools.