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.