I'll assume you're talking about equivalent focal lengths and not strictly megapixels because I think that is what you meant based on how you asked your question. If you simply down sampled a
M2P image from 20MP to 12MP, it would always look better (all else equal) because that is one way to improve image quality and hide flaws (by down sampling higher resolution images). The focal length does not change in that example though.
To answer your question, it can be the same, but with the two sensors in question the resolution would not be equivalent. The
M2Z actually has a higher pixel density than the
M2P because of the sensor size difference (this isn't necessarily a positive thing - the
M2Z sensor is so small that even with 12MP it has a very high relative pixel density). To put things in equal terms, a 12 MP 1/2.3" sensor is approximately equivalent to a 67MP full frame camera, and a 20 MP 1" sensor is approximately equivalent to a 54MP full frame camera. The crop factor on a 1/2.3" sensor is about 5.6 and the crop factor on a 1" sensor is 2.7 (relative to 35mm full frame which is how most equivalencies are done).
The
M2P has a 28mm equivalent focal length, the
M2Z has 24mm-48mm equivalent focal lengths. I say equivalent because even DJI expresses the focal length in full-frame terms which is the norm - the actual focal lengths of the lenses on each drone are much smaller (divide the focal lengths by their crop factor to get the actual focal length).
So if you wanted to crop a
M2P (still) image (28mm FOV) to a 48mm FOV to match the maximum zoom of the
M2Z, you would need to apply a crop factor of about 1.7, which would reduce the resolution from 20MP to about 6.9 MP, which is below the
M2Z resolution all else equal. A
M2P image cropped to 12MP would only get you to about 36mm equivalent.
It doesn't end there though, there are other considerations. The quality of the pixels on the
M2P are much higher as they can collect more light (better dynamic range, better ISO performance), and also the
M2P can maintain a constant F2.8 aperture where the
M2Z drops to F3.8 at 48mm. So, there is some subjectivity involved still.
And that is just for stills. Video adds a whole new layer of complication. For example the
M2P has a field of view (FOV) of about 77 degrees in FOV mode, and 55 degrees in HQ mode, which is effectively cropping without reducing resolution as both are 4K. The FOV's on the
M2Z are 83 degrees (24mm) and 48 degrees (48mm) for comparison.
From my point of view anyway, and based on my usage, it's hard to make a case for the zoom. You can achieve almost the same FOV's with the
M2P with a much better sensor, full aperture control, 10bit D-Log/HLG and much better stills.