Teams over the cap aren't inherently in salary cap hell. Teams over the cap with long-term contracts off players who are either terrible or no longer playing often are. Obviously, a team with Shaq and Kobe is going to be good even with two max salaries (actually, at least Shaq was more than the max salary). You can get a solid player who will work for the mid-level exception (particularly for a chance to win).
But how many teams who have been terrible for years are also
over the cap? The draft really isn't strong enough to get out of a funk. Teams that end up rebuilding and doing well essentially have to completely blow up their team and start over - massively shed salary by trading for expiring contracts and letting all good players on your team walk.
The NBA is much better for dynasties compared to other leagues - the Lakers and Spurs can build up a run of championships. But it's nowhere near as good for parity and plenty of teams will be terrible for years at a time (compared to the NFL where only the chronically mismanaged will stay terrible).
The NBA doesn't make dynasties any easier to create than the NFL. In fact, as I already pointed out, the NFL actually does more to hold it's star players to one team than the NBA does. The reason dynasties have developed in the NBA is that some teams, namely the Lakers and most recently, the Spurs perhaps, are better run than the other franchises. We'll have to see if Miami actually has a dynasty going.
The natures of the two games are factors too since there are more players involved in football providing more variables for winning and losing, the importance of the (NFL) quarterback position, the offense/defense dynamic. In the NBA, you can win championships with one or two superstars at any position and competent play from starter role players and back-ups and most importantly, "chemistry".
But what we are really talking about here is the incompetent versus the competent. Most teams in the NBA are simply incompetently run. They invest in the wrong players for too long, and that is the bottom line here. If you give too long contracts to bad players you lose, regardless of "salary cap hell" or whatever. You choose the right players, invest in them long term and in the process get capped out, always end up with high draft picks (who are long shots to make it in the league), and you can't continue to sign big name free agents. But, presumably, you're winning so who cares?
This is the way the Lakers have done it over the years, before there was a cap and since the cap. Even if in "salary cap hell" as you call it, a team can still make good trades, and this is something else at which the Lakers have excelled. But, it takes knowing who to trade, when to trade, and who to acquire.
The concept of "salary cap hell", I think, is mostly an invention by incompetent owners seeking to justify their own incompetence -- "it's not our fault we're losing, we are caught in salary cap hell", like it wasn't their own fault.