Yes, it's certainly possible to reinstall macOS after erasing and using Linux (or anything else for that matter), but downloading the macOS installer without already having some version of macOS running is a little tricky. It generally involved booting into recovery mode over the Internet, which can be rather slow.
IMO it'll be a lot easier to reinstall macOS with you build an installer disk, and it's easiest to build an installer disk under macOS before you erase it. The basic procedure is to use the App Store to download a copy of the macOS Sierra installer application, plug in a flash disk (at least 8GB), use Disk Utility to reformat it with the GUID partition map (aka GUID partition table aka GPT) format, then use the
createinstallmedia tool to clone the relevant bits of the installer app to it (details here) (or use DiskMaker X to handle the details for you).
Keep the installer drive around, and when it comes time to reinstall macOS, plug it in, start the Mac with the Option key held down, and select it as the startup volume. Then you'll have all the recovery and reinstall tools available, without needing to boot over the Internet.