But building AI isn't the same as defecting in the Prisoner's Dilemma because it risks harming the defector too, if there is loss of control.
If we're talking game theory, a better model is the Stag Hunt [1]. At some point the equilibrium strategy is to cooperate.
Another difference is that real life is an iterated game, and the iterated prisoner's dilemma rewards cooperation.