Can I install Yosemite on a different Mac with another Apple ID Can I use a copy of OS X Yosemite installer to install Yosemite on a Mac owned by someone else who obviously has a different Apple ID?
Yosemite should be a free upgrade.

You can also download it for free here.

https://www.macupdate.com/app/mac/48498/os-x-yosemite