Windows 10 in S mode does not allow the installation of Firefox or other apps from outside of the Microsoft Store. To install Firefox, Microsoft requires you to switch out of Windows 10 S mode. Afterwards, visit the Firefox download page to install Firefox.
See the Windows 10 in S mode FAQ article at Microsoft Support for more information.