I'll state one version of the theorem, valid for classical systems. I'll not give the most general framework, as things become messy, but this should still give you an idea of how general the result is.
We need the following ingredients:
- Spins: to each vertex of the lattice $\mathbb{Z}^2$, we attach a spin $\phi_x$ taking values in some compact topological space $S$.
- Symmetry group: a compact, connected Lie group $G$ acting on $S$.
- Interaction: a piecewise-continuous function $U:S\times S\to\mathbb{R}$, invariant under the action of $G$: $U(g\phi_x,g\phi_y) = U(\phi_x,\phi_y)$, for each $g\in G$.
- Coupling constants: a collection $(J_x)_{x\in\mathbb{Z}^d}$ of nonnegative real numbers, such that $\sum_{x\neq 0} J_x<\infty$.
We then consider the formal Hamiltonian
$$
H(\phi) = \sum_{x\neq y\in\mathbb{Z}^2} J_{y-x} U(\phi_x,\phi_y).
$$
There is no loss of generality in assuming that $\sum_{x\neq 0} J_x = 1$ (since one can always rescale $U$). With this normalization, we can consider the random walk $X$ on $\mathbb{Z}^2$ with transition probabilities from $x$ to $y$ given by $J_{y-x}$.
The statement then takes the following form: Under the above assumptions, all infinite-volume Gibbs measures associated to the formal Hamiltonian $H$ are invariant under the action of $G$, provided that the random walk $X$ is recurrent.
As an example, consider the case of the $O(N)$ model. In that case, $S=\mathbb{S}^{N-1}$ is the $(N-1)$-sphere, $G=O(N)$ is the group of rotations of $\mathbb{S}^{N-1}$, $U(\phi_x,\phi_y) = -\phi_x \cdot \phi_y$ is minus the scalar product of the two unit vectors. The above result shows that all infinite-volume Gibbs measures associated to the $O(N)$-model are rotation invariant (which implies in particular that there cannot be spontaneous magnetization) as soon as the random walk $X$ is recurrent. Interestingly, it is known, in that case, that there is spontaneous magnetization (and, thus, spontaneous breaking of the rotation symmetry) at low temperatures, as soon as the random walk $X$ is transient. If you prefer a more explicit criterion, restrict your attention to the case $J_x \propto |x|^{-\alpha}$. Then the previous discussion implies that there is spontaneous symmetry breaking at low temperatures in the $O(N)$-model if and only if $\alpha<4$.
[EDIT:] Here's an (very incomplete) list of references for some of the points mentioned above.
Version of the theorem given above:
2D Models of Statistical Physics with Continuous Symmetry: The Case of Singular Interactions, D. Ioffe, S. Shlosman and Y. Velenik, Commun. Math. Phys. 226, 433-454 (2002). arXiv:math/0110127
(The result is actually a bit more general than the one stated above.)
Proof for general graphs (under the assumption that the associated random walk is recurrent and for twice continuously differentiable interaction $U$):
Recurrent random walks and the absence of continuous symmetry breaking on graphs, F. Merkl and H. Wagner, J. Statist. Phys. 75 (1994), no. 1-2, 153–165.
(Again, their results are substantially more general than that: they treat not necessarily ferromagnetic couplings, quantum systems, etc.)
Proof that $O(N)$ models on $\mathbb{Z}^d$ display spontaneous magnetization at low temperatures as soon as the associated random walk is transient:
The Mermin-Wagner phenomenon and cluster properties of one- and two-dimensional systems, C. A. Bonato, J. F. Perez, A. Klein, J. Statist. Phys. 29 (1982), no. 2, 159–175.
You can also check Theorem (20.15) in
Gibbs measures and phase transitions, H.-O. Georgii, de Gruyter Studies in Mathematics, 9. Walter de Gruyter & Co., Berlin, 1988.
There are of course many other relevant references. Please check the bibliography given in these references.