Many countries have some similar requirement. The WIPO lists 34 member states with some foreign filing rules.
Some require it if the inventing was done in their country, others have rules for residents/citizens regardless of where the inventing occurred. Some only limit filings that contain “state secrets”. The linked table at the WIPO has a summary.
The U.S. requires a foreign filing license if the inventing was done in the US. Most countries provide a default of a license upon filing locally. That is, unless you hear otherwise within a set time frame you have a license. To file first non-locally you need to explicitly request a license.