Let's say you are a referee in a match, with team A and team B. Furthermore, you can't side...
Either of the teams
Either of those teams
Can I use either of them interchangeably or is there any difference?
You can use either of those phrases for this purpose, they are both grammatically correct and carry mostly the same meaning.
However, there is a subtle difference between them that might mean the first option is preferable.
Indeed, the second phrase,
Either of those teams.
could be understood as insinuating that there are more than 2 teams participating in the match since you apparently needed to specify that you were talking about "those" teams and presumably not the others. There is no such potential for misunderstanding with
Either of the teams.
here, the use of the definite article "the" emphasizes that the two teams denoted by "either" are in fact representative of all the teams. There are only two teams and the speaker is discussing them both.
While all this is true, I do want to repeat that the difference is subtle and that in practice it's unlikely anyone would actually be confused about the number of teams that are participating in the match (unless it's a game they've never heard of before), so effectively you can use either sentence, especially if conveyed verbally.
On a side note, the correct phrasing would be "You can't side with either of those/the teams". Without the "with" both sentences are wrong. Also, if you felt so inclined you could skip "the/those" and simply say "You can't side with either team." It's grammatically correct and actually the way most native speakers would probably phrase it.
While both expressions are perfectly correct, either of those teams refers to teams that the speakers have already identified. The phrase either of the teams is not specific.
For example, if selectors were watching a game, one might say to the other:
Either of those teams could win through to the final.
In this instance, it is clear to both selectors that they are talking about the two teams on the field.
But if the ground manager were awaiting the arrival of the team buses before a match, s/he might say:
Let me know if either of the teams shows up before three pm.
The reference to the teams is less specific. It doesn't indicate which teams are involved. It just informs us that there are two teams.
In the same way if one says those dogs are noisy tonight, one refers to specific dogs. If one says the dogs are noisy tonight it might refer to any dogs.