2018 Mac mini - Original OS macOS 10.14 (18A2063) 18A2063 is the unique build number for that model. The next compatible public release would be 10.14.1. No version of OS X can be installed on the model which includes 10.8.x.
2020 iMac - The machine is too new to know the exact version of Catalina that is installed. I can only guess that it would be 10.15.3 or later because they were released in Jan, Mar, and May of 2020, respectively. I don't remember the release month for the computer.
The 2020 iMac will not even be able to run Mojave. Note that OS X technically ended with El Capitan. Thereafter, it was renamed to macOS. It is now consistent with iOS or iPhone OS, iPadOS, tvOS, and watchOS.
As a general rule no version of OS X or macOS will run on hardware that was released prior to when the OS version was released. Apple has kept that relationship fairly consistent. OS versions released, say, during 2018 will not work with hardware released earlier than 2018. There is some overlap because a new major release of the OS is, now, scheduled each year with the new version released in Oct/Nov, usually. However, new hardware is not on the same schedule. So, a Late-2017 model may only work with the 2018 OS release if there has been a major change in the hardware.