(N/A) For sound waves,the medium plays a crucial role. The two situations are not physically equivalent because the motion of the observer or the source relative to the medium is different in each case. Therefore,the Doppler formulas for sound are not identical.
For light waves in a vacuum,there is no medium. According to the principle of relativity,the speed of light in a vacuum is a universal constant $(c)$ and is independent of the motion of the source or the observer. Thus,the two situations are physically equivalent,leading to identical Doppler formulas.
If light travels in a medium,the medium provides a preferred frame of reference. The speed of light in a medium depends on the refractive index of the medium. Since the motion of the source or observer relative to the medium would be different in the two cases,the Doppler formulas would not be strictly identical.