Before feedback cancellation techniques became common, such an effect would happen even with one pair of phones, e.g. phone A calling phone C. If both phones are on loudspeaker, then the signal emitted by the phone A would go into A's microphone and get transmitted to the phone C, where the same feedback between the loudspeaker and the microphone would re-transmit it back to A, etc:
SPK_A -> MIC_A -> SPK_C -> MIC_C
This problem is prevented by subtracting the loudspeaker output signal for the microphone input. However, for such a software subtraction to work, phone A needs to know what to subtract: if A is the only phone in the room, it can subtract its own loudspeaker output, and feedback cancellation works as intended.
With a second pair of phones, feedback cancellation fails because the signal emitted by the phone A is picked up by the phone B instead. As the phone B doesn't know what signal A was emitting, it cannot subtract it from its microphone input, and sends it to phone D:
SPK_A -> MIC_B -> SPK_D -> MIC_C
There is a second (symmetrical) feedback loop that is possible:
SPK_B -> MIC_A -> SPK_C -> MIC_D
As you can see, the loops are closed, and there is no opportunity for the feedback cancellation software to break those.
In order to prevent the noise, you'll have to break the cross-phone loops physically, e.g. by muting both loudspeakers (switching to earphone) in one of the rooms (e.g. A and B), or in one of the calls (e.g. A and C).
Indeed, muting the microphones, being in separate rooms or having a single call at a time would also help, but I suppose those are not real options.