I would like to answer the question from a German perspective.
Compared to their direct competitors from Audi and Mercedes, BMWs are about average in durability.
They used to have notable rust problems in the past. On the other hand, Mercedes performed far worse in this regard, while Audi pioneered in using fully zinc coated sheetmetal in the early 1980 - unless their body has been damaged in an accident, Audis are rustproof.
Let me put it this way: if I had to count on a car to get me through the zombie apocalypse, it wouldn't be a BMW. I've worked on them, worked in the same dealership next to them, (Lexus and BMW), and nothing about a BMW makes me think “durable”. The engines and transmission seem to hold up ok but the rest of the car falls apart around them, including many of the sensors the engine relies on to actually run.
Many people will tell you that BMWs will be reliable if you keep up on maintenance. That is absolute nonsense, and it reveals a misunderstanding of how modern cars are built. For the most part, cars these days have much more reliable mechanical parts — engines, transmissions, suspension systems and all of the associated parts that go along with these three major systems. But where failures often come now are in electrical parts, and there simply is no way to maintain electrical parts. BMW also has been known to have problems with their turbos, and those are extremely expensive parts to repair and replace. You'll need ask your accountant if you have the cash flow to repair your car! 🙂
I think that several good answers have been provided already. As an owner of a BMW I asked myself the same question for months. Arguably, at the end of the day, the best answer I received was provided by a local mechanic who knew how to work on German cars and it was that “if properly cared for, BMWs and most German cars can get to 300k miles or more”. The issue is that very few people properly care for them as it gets expensive and so the risk to buy a used lemon is fairly high.