Is there any PhD program does not accept foreigners due to its strategic importance? I have heard that some countries do not allow others to have specific skills to avoid them earning strategic skills, e.g., about nuclear physics, or the genome.

Are there any examples of students not being except just because of their origin, religion or interest in special topics as a foreigner?
As ff524 mentioned. Prospect Iranian students at USA universities are not allowed to study nuclear or petroleum science. 
If you apply for scholarship of Mexican government, you will not be awarded if you want to pursue degree in tourism, culinary study or plastic surgery!!! 
Most countries, i think all of them, but I am not sure, dont permit law, police, national security, military,teaching positions, to citizens of other country. or if they permit, they will not give you right to work after finished studies.