How does this work with hosts that are not resolvable outside your own network? If I tell firefox to go to internalsite.mycompany.com - which resolves internally, but not outside our network - how is firefox going to resolve it, if it's not using our DNS servers?

Correct.

In order to preserve compatibility, Firefox's implementation has a "fallback" where if it sees that it can't resolve a domain, then it will fail back to using the system-configured DNS provider.

You can also exclude specific domains but at this point they have to be written in about:config.

https://support.mozilla.org/en-US/kb/firefox-dns-over-https#...

It looks like Firefox Policies can be used to enable, disable, or specify the DoH provider but cannot yet specify excluded domains.

https://github.com/mozilla/policy-templates