Is it possible to choose which macOS version to use when reinstalling? I have Mountain Lion on my Mac, but I would like to erase all the data and reinstall OS from Mac Utility (Command + R when restart), but as far as I know there is no option to chose which macOS you would like to get...

It is kind of random choice of Mac Utility system...

So, question is there any way to choose OS (for example Catalina)?
When you boot to the Recovery mode option using Command-R, the Mac will restore the version of macOS which is currently installed on the Mac. Mountain Lion will be reinstalled if you use this key combination.

If you use Option-Command-R it will install the version of macOS that was originally installed on your Mac, or the closest version still available. If your Mac was purchased with Lion installed, Lion will be installed if it is available. 

Apple Support information about macOS Recovery.