Do you have the 'S' version of Windows 10 Pro?
Windows 10 S can only install apps from Microsoft Store.
To find out if you have Windows 10 S:
Start menu > Settings app > System > About > Windows specifications > Edition
If you're running in S mode, you will see "Windows 10 Professional in S mode"