In the US, it is no more OK, legally, to discriminate in hiring on the basis of nationality for any nationality compared to any other.
But even then, it is not, as suggested upthread, more OK for Iranians to hire Iranians than for Americans to hire Americans, whether talking about nationality, national origin, or ethnicity. (Fir nationality, there are narrow cases where the latter is mandatory and the former is prohibited no matter who is hiring, sure, but that's the opposite of what was suggested.)
I would wager that conditioning on US citizenship is less restrictive than conditioning on any other citizenship when seeking diverse historical nationality.
There are exactly two jobs where that is required, and only one is kind-of in the military, in that it is legally the apex of all military chains of command.
(There are other security-related, especially in the military, jobs where actual or potential dual citizens, the latter more commonly being an issue when people have foreign born parents, may be required to renounce any other citizenship than American.)
It is absolutely discrimination, but legal (and legally-mandatory) discrimination. That it may be “common sense” does not change that it is, absolutely, discrimination.