Praise be to Allaah.
If it is worldly knowledge that is beneficial to the Muslims, and it cannot be learned in a Muslim country, then it is OK to go to the kaafir countries, on the condition that the person is religiously committed and knowledgeable enough to be safe from desires and doubts.
It is not permissible for us to help the enemies of Allaah with programs that may cause harm to the Muslims and give the kuffaar more power. Allaah says (interpretation of the meaning):
“Help you one another in Al-Birr and At-Taqwa (virtue, righteousness and piety); but do not help one another in sin and transgression” [al-Maa’idah 5:2]
This applies whether the harm is something that may happen in the future, which is the situation when there is peace, or is something that may happen immediately, as in the case of kuffaar who are in a state of war with the Muslims. The means of earning a halaal income are many, and whoever gives up something for the sake of Allaah, Allaah will compensate him with something better.