Have you ever tried to boil water in a paper cup? It will likely burn away above the water line, but the heat transfer into the water will keep the paper below it's ignition point. A gas flame can exceed the melting point of aluminum, but that can't happen when water is on the other side as it will absorb the heat faster, limiting the actual metal temperature. If the tubing gets enough thickness of mineral deposits, their heat transfer capability isn't as good as aluminum, and will act like an insulator, allowing the metal to get hotter than the design limits. Some tankless systems have a maximum hardness rating, and all of them require periodic cleaning to get rid of them before they become a problem.
A tankless heater is one appliance where it is really important to follow the maintenance instructions, not only for good performance, but for longevity, too. If your water is harder than suggested, you might have to shorten the time between demineralization maintenances. Or, if you use more hot water than the norm, as it is a function of the volume of the water used, and how hard it is, so annually, may not be often enough with high volume use and/or harder water than normally suggested as allowed. Have soft water, and you could probably extend those demineralization maintenance routines.