Spin conservation in pair production In QED, when two photons collide, they can turn into an electron and positron pair. We know from $U(1)$ gauge symmetry that the total charge of the initial and final states must be conserved. On the other hand, I expect that the total spin must also be conserved. But I do not quite get the details of how this works.
In this post the total spin of two-photon-state is discussed. Based on the transversality argument, OP argues there are three distinct spin states associated with the two-photon system. Two of them correspond to the spin-0 representation and the remaining one corresponds to a spin-2 state.
Based on the above argument, if the total spin in pair production is to be conserved, I would assume that the incoming photons must be in the spin-0 state, excluding the spin-2 state because the spin-state of the created electron-positron pair does not have a spin-2 representation. As far as I know, this spin state can have one spin-0 rep. and three spin-1 rep.
Edit: Also, in Wikipedia page there is Landau–Yang theorem, stating that a massive particle with spin 1 cannot decay into two photons. I suspect this selection rule follows from the requirement of the conservation of the total spin. Because as suggested in the linked question two-photon state does not have a spin-1 rep.
Is this reasoning correct?
The second point is about symmetry. If the total spin is to be conserved, what is the associated symmetry? I am thinking it must the rotational invariance of pair production amplitude. But what do the generators of this rotational symmetry look like? and where do they act? These generators must not correspond to the ordinary rotations in space. Because this would correspond to the conservation of orbital angular momentum, not spin.
 A: Spin angular momentum is not conserved; only the sum of spin and orbital angular momentum is conserved. As a trivial example of this, consider a hydrogen atom decaying from $2p$ to $1s$ by emitting a photon. The photon carries one unit of angular momentum, but the spin of the electron doesn't change; instead orbital angular momentum is lost.
Furthermore, in many situations you can't even unambiguously define the two separately (how much of the proton's angular momentum is due to the angular momentum of its constituents?), so "conservation of spin" is not even meaningful. Conservation of total angular momentum is always meaningful, because it's the conserved quantity associated with rotational symmetry.

Based on the above argument, if the total spin in pair production is to be conserved, I would assume that the incoming photons must be in the spin-0 state, excluding the spin-2 state because the spin-state of the created electron-positron pair does not have a spin-2 representation. As far as I know, this spin state can have one spin-0 rep. and three spin-1 rep.

No, because the electron and positron can come out in the $p$-wave, carrying orbital angular momentum. This is called $p$-wave annihilation, and it's not an exotic phenomenon; for instance, it shows up in the partial wave expansion in undergraduate quantum mechanics.

Landau–Yang theorem, stating that a massive particle with spin 1 cannot decay into two photons. I suspect this selection rule follows from the requirement of the conservation of the total spin.

The Landau-Yang theorem doesn't state that spin is conserved. Essentially, it uses the fact that total angular momentum is conserved, along with the fact that in this simple situation, there is no orbital angular momentum: you can always go to the rest frame of the massive particle, and in that frame the photons always come out back to back.
A: In the Feynman diagram below time runs from left to right. Indeed a 2-spin state for two photons can have eigenvalues 2, 0, and-2. That is three eigenstates at least. I'm sure you are right we have to consider the combined (2-photon) state. If that's the case then this state got to have a spin-0, precisely because of the fact that the positron-electron-state got to be in a spin-0 state.
When you consider the states of the photons separately (at the vertices) you have to consider the spins of two real and one virtual particle (the propagator electron-positron). In this case, too, it holds that the photons at both vertices got to be a spin-0 state. I'll don't bother you with the math. That would require too much space in this answer and it can be found in any book on QFT.

Considering your second question. What generator of which symmetry we have to consider? This symmetry obviously has got something to do with rotation (as spin does, intuitively, although spin isn't a rotation in common sense). Like @anna v rightly remarked it's the conservation of angular momentum one has to consider. If angular momentum is zero, as we assume in this case, to account for the spins one can't apply the normal generators for the conservation of angular momentum. So automatically the spin states will be as they are. And they are just as your reasoning told you (and us).
