Yes and its much more rational to see that the invaders are natural born liars and they installed puppet dictatorships while talking "democracy" and very literally a few days ago backstabbed and invaded you while in the pretense of doing peace negotiations. Logically for an Iranian the most rational response would be to always kill Americans or Israelis in this case.
War is about achieving political ends, which killing may or may not be instrumental towards. It's very unclear to me whether Iran's killing of Americans and Israelis, either directly via missiles or via their proxies, had realized any benefits for the nation of Iran, let alone for the average Iranian.
American and Israeli soldiers are invading Iran currently. So just like standard procedure for any war, killing as many enemy combatants as possible is the point and beneficial for Iran as it aids toward repelling the invasion. America at least can be pressured to withdraw as the general populace is ambivalent about the war.