Momentum conservation when virtual photon decay into lepton pair

I know the fact that one photon can not decay into electron-positron pair.

at the CM frame, the momentum of electron + positron is zero. However, the momentum of a photon can not be zero.

Though, I saw that some diagrams included virtual photons which decay into lepton pair.

In these cases, the virtual photon is emitted, and decay into a lepton pair. How can it work? I just thought that a virtual photon is almost the same as a real photon, except a virtual photon is created and annihilated inside a diagram.

Is there any other rule for the virtual photon?

Short answer: The second diagram is not the same as the first. In the second diagram there is another massive charged particle (top quark) present.

A photon cannot spontaneously decay (you used the word decay which is technically not the same as pair production) into an charged lepton-antilepton pair because the leptons have a rest mass/rest frame while the photon does not, and also because of your explanation using momentum conservation.

But since a photon couples to the field of other charged particles (top quark in this case), it is possible (and indeed a finite probability can be calculated) that a lepton-antilepton pair can be created during this interaction. The massive field of the top quark can interact with the (charged) lepton and antilepton fields, such that the two particles acquire momentum/energy and become on-shell or real (non-virtual) particles.

The rule for virtual particles is that they respect energy-momentum conservation at vertices but they do not need to be "on-shell", which amounts to saying that the combination $$E^2 - p^2 c^2$$ does not necessarily give the square of the rest mass of the corresponding real particle.

This is the lowest order diagram of how a photon, of energy higher than the added mass of the electron positron, can produce an electron positron pair. Momentum conservation is taken up by the field, in this diagram of a nucleus Z.

Feynman diagram of electron–positron pair production. One must calculate multiple diagrams to get the net cross section

In this case the virtual particles that balances energy and momentum conservation and lepton number, is a virtual electron interacting with a virtual photon with the charge of the Z nucleus.

The second diagram does not need external fields because the Higgs has a mass, and there is no momentum and energy conservation problem in the center of mass, as there is with a photon that has mass zero and no center of mass at rest as it always moves with c.