To abide with Apple’s terms of use, you must go through official channels to obtain the macOS installer. This guide will also be useful for those who can run Virtual Machines of macOS in environments like VirtualBox etc. As an owner of a MacBook Pro, it’s slightly unsettling that I wouldn’t necessarily be able to plug in a bootable USB or insert a DVD with the macOS installer image in the event that I needed to re-install my OS because my SSD ate the dust, or something. OS X was a different story, but also you had to pay for those versions.
Normally you can’t obtain bootable media of macOS.