Comparing O(N) and SU(N) × SU(N) spin systems in 1 + 1 dimensions to SU(N) gauge theories in 3 + 1 dimensions