Stopping Nazis was ok because that was a political belief system.
Much of the US government is under the impression that Islam is a religion. It is a political system. Assuming you can detect or discern their belief system, you can ban them too.
Detecting their belief system, especially given their Taqiyya, is the problem. So didn’t Trump say ban from predominantly Muslim countries?
I believe you are correct on Trump’s statement.
I believe, with the Nazis, it was countries as well as those that could be proven (or suspected) of ties to Fascism.