If you are a repair shop or IT administrator, you may legally download the installer once per Apple ID, then deploy it across multiple eligible Macs.
Here’s a clear and informative text regarding the download of the macOS Sierra 10.12.6 DMG file:
How to create a bootable USB installer (assumes you have the macOS Sierra Installer app)