Do all four tires on a 4WD/AWD need to be identical? Yes and no.
On a 1972 Chevy, Ford, Dodge with an NP203 full time 4WD transfer case, no. It has a center diff, front diff, and rear diff, with no clutches or monitoring electronics. All four tires can rotate independently of each other.
On a 1972 Chevy, Ford , Dodge with a n NP205 art time transfer case with a 2WD setting, NO.
A vehicle of this construction should never be placed into 4WD in a high traction situation, so then the diameters only matter when in the slick stuff, and then it really doesn't matter anyway.
On a modern AWD, or 4WD with "auto" setting yes, as these are active when driving even on pavement, and a larger diameter tire will be seen as a slipping tire.