Yes the enemies will be equipped with best guns out there but to overcome that problem, Karrar needs better armor which has already been improved significantly.
Now if it survives a direct hit of enemies' tank shell (which has nothing to do with its gun), let's see if it can fire back and destroy the enemy tank:
View attachment 384369
http://fofanov.armor.kiev.ua/Tanks/ARM/2a46.html
The difference between 2A46M and -5 variant is:
1- Barrel life is 50% more which is due to -5 having the chromium linear. I don't see this being a tough upgrade for Iranian industry and might as well have been added to what they are using on Karrar.
2- Everything else is the same but the max chamber pressure. Higher chamber pressure resistance allows -5 to fire APFSDS while the one on Karrar can't. To my knowledge Iran does not posses or produce APFSDS shells.
Barrel life is important but I don't think it is something Iran can't overcome. Shorter barrel life in M varriant is due to high strain on interior surface of the barrel. With the technologies available today, it's is much easier to solve this problem than it was back in 70s and 80s.
Use of APFSDS, although important, is a mute point for Iran as they don't have the projectiles anyway. Working on more efficient ATGMs can overcome this problem which Karrar is capable of using.
So again and given the circumstances, yes it would be ideal to have the best gun out there, but the reality is we don't and it is not something that cannot be made up for with other measures. Between a lower grade gun that Iran can produce locally and a higher grade one that needs to be imported, I would go with the local one every day.
Kornet missile VS Abrams in Iraq:
Saudi Abrams destroyed using guided missile (said to be Iranian Tousan):
http://foxtrotalpha.jalopnik.com/houthi-rebels-destroy-m1-abrams-tanks-with-basic-irania-1726478735