No, a team itself isn't penalized for two personal fouls—but an individual player can be.
In basketball, a player who commits more than six fouls (in certain leagues) fouls out and is disqualified from the game. So the penalty falls on the player who accumulates too many, rather than on the team as a whole.