As previously mentioned, there's a lot of different troubleshooting steps you can take in order to quickly narrow down the potential causes and that's good advice. The reason being, there is no specific solution for that specific error occuring on your specific PC. Application install failures are nearly always the result of another running background process/es that crashes the application installer. Hence, the advice regarding troubleshooting procedures.
However, I'd suggest you try a simple (time proven) "Diagnostic Startup" solution first: Close any running apps then type "msconfig" in 'search programs and files'. Right-click msconfig.exe and select run as administrator which opens the system configuration dialogue box. Under the general tab note which startup type is currently selected, then select 'Diagnostic startup', click apply, click ok, but select 'restart later' not 'restart now'.
Open search again and type "services" (run as admin), which opens the services control panel. Scroll down the list to "Windows Installer" and double-click it, which opens the windows installer properties dialogue box. Set 'startup type' to 'automatic', click apply, click start, click ok, close services control panel, and now reboot. Now try installing 365 and if successful, open msconfig again and simply select your original startup type, then reboot.
Edit: Read this MS article:
Use the Office 2016 offline installer
If you end up stuck with having to use the web install, simply start all the following network services at the same time you're in the Services control panel starting up the Windows Installer service. After reboot proceed with the 365 web installation.
Background Intelligent Transfer Service
COM+ Event System
Computer Browser
DHCP Client
DNS Client
Network Connections
Network Location Awareness
Remote Procedure Call (RPC)
Server
TCP/IP Netbios helper
Wireless Zero Configuration
WLAN AutoConfig
Workstation
.