For most U.S. patent practitioners, deciding where to file a first patent application used to be simple: if the invention was made in the U.S., applications could not be filed outside the U.S. without a foreign filing license. The typical filing plan was therefore to file the application first in the United States and then file abroad when the foreign filing license was granted. Invention these days, however, is not always a single country activity. Citizens or residents of multiple countries often collaborate, and this can complicate where the first application can/must be filed and whether foreign filing licenses from one or more countries need to be obtained.
WIPO has a helpful web page on international applications and national security considerations. The following chart based on the WIPO web page can help identify potential foreign filing issues. If you end up checking one of the boxes on the right hand side of the chart, you should consult the laws (or better yet the lawyers) of that country before proceeding.