The example you’ve provided has nothing to do with patents and everything to do false marketing. If you rebrand something in Iran and sell it for something it is not then it is an illegal act and you will be prosecuted. Doesn’t matter if the brand owner is foreign or domestic.A foreign company that has an office or representative in Iran can file for its patent and those patent and trademark will be protected .
once at the time of Khatami, Kingston Technology used that and get a court ruling and police raided PC shops and gathered all fake Kingston RAMs . at the time even if police would have found a single fake ram in a shop would have confiscated all their Kingston Rams . but sadly sanctions made many companies leave Iran and then we didn't saw such move anymore but neverthless the law is still there and companies whho directly do business with Iran can use it to protect their IP and trademarks