I went to the Apple Store today and was planning on purchasing a Mac Mini Pro 2.
What were you planning to do for a display?
The display in the iMac is going to be hard to beat
if a 24" 4.5k display is just what you want - but if you want some other combination of size/resolution (maybe you want a pair of affordable 27" 4ks, or a 30"+ 4k screen, maybe you want to shell out for a 27" 5k) the Mac Mini would be more flexible.
It's likely that the regular M3 will be as good or better than the M2 Pro for some applications - it will likely depend very much on what applications you are using and whether faster single-core performance trumps having more cores. I doubt that the difference will be life-changing unless you have something that uses the hardware ray-tracing in the M3 GPU.
However, the "M2 Pro vs. regular M3" distinction is about more than just raw speed - the I/O and display support capabilities of the "pro" are an important difference. The regular-M3 iMac will either have just 2 TB ports or 2 TB + 2 USB C 3.2 ports (you'd need to check) and only supports 2 displays (i.e. the internal display + 1 external display). The M2 Pro Mini supports 3 displays, has 4 Thunderbolt/USB-C ports and the i/o bandwidth to back them up - plus a HDMI port which can free up a TB port in some cases.
Also - check the storage on the iMac. The iMac starts at 256GB, which is ok for basic use but a bit tight once you start installing 'pro' software, working with video, running virtual machines etc. The M2 Pro Mini starts at 512GB which is a more sensible size in 2023.
I don't think either choice would be bad - it depends on what your needs are. There will probably be M3 and M3 Pro Minis along sometime this year, but nobody knows for sure - and with the M3 vs. M3 Pro its even more important to remember the I/O and display support advantages of the Pro, and not just compare cores.