Yes, you can dual-boot two versions of macOS on a Mac. All you need to do is make sure your Mac model is able to run the operating systems, make enough space for two macOS installations, add a new volume for the second macOS, install macOS on the new volume, and then switch between two operating systems as you like.