No, you do not need to buy Call of Duty: Modern Warfare 3 to play Warzone. The latter is a standalone, free-to-play title offered by Activision. It is available for download on all major gaming platforms, including the PlayStation 4, PlayStation 5, Xbox One, Xbox Series X|S, and PC.
Simply put, yes, you can play Warzone 2 without buying MW2. However, the process can be tricky. Confusion about the link between the two titles is likely rooted in two different factors: Downloading Warzone 2 without MW2 has been made difficult in the past.