I have Yosemite installed on a Parallels 16 VM. It was a very laborious process. I went around and around with lots of combinations and eventually this is what worked. This could probably be optimized, though.
1. Downloaded Yosemite InstallMacOSX.dmg installer from the Apple Legacy OS page.
2. Created a MacOS VM using the recovery partition (for me it's Big Sur).
3. From within the Big Sur VM, I ran the InstallMacOSX.pkg, which created an "Install OS X Yosemite" app in the Applications folder. (I ran this in the VM because I didn't know what it would do and if it would mess-up my host machine)
4. Copied the Install OS X Yosemite app to the Host machine.
5. Now I created a new VM with GuestOS option and drag/dropped the Install OS X Yosemite.app to start the process. It did say it needed to create a bootable disk image and I gave it a name and location, and everything worked.
6. For some reason, I felt like I needed to keep the Configuration settings unlocked while creating the VM. Seems like a previous attempt it said something like it needed access to the host credentials??? I forget. This whole process seemed way more painful than it needed to be.