Yes, they can run on the same machine, depending on the kind of installation, you can even run them side by side at the same time. Using Windows it is easy, simply take the portable version and if you want to use it with the same account it will use and share the settings with the version you have installed, but this allows only one version at a time.
If you use a second, third, fourth, …, user-account and your machine is capable of running several versions simultaneously, you can do even that.
Here, in this posting, I describe it for Windows and show an old screenshot from me where I ran 7 versions of Krita simultaneously:
For Linux, you have to work with so-called home-folders or also like using Windows via different user accounts. The first version allows running the versions one after the other, the last option with different accounts allows running them simultaneously.
For macOS, I can’t tell it for sure, but it will very probably the same. So, if working with own home folders or user-accounts for each version.
Michelist