Is it possible for a player to be on two teams at once?
From the Minecraft Wiki:
It is important to note that each individual team member can only be on one team; teams cannot share entities.
So the answer to your question is No, but however, if a player is already on a team and you try to assign it to another team, it overwrites the player's previous team. Meaning, if there are some players on teamA
and you run /scoreboard teams join teamB @r
, the random selection could pick a team member already on team A, and move them to team B.
You can fix this by making sure that the random selection selects players not on a team, like this:
/scoreboard teams join teamB @r[team=]
(team=
selects entities that are not on any team.)