No, it's not solely due to gun ownership laws but also and primarily to the fact that the US is a much more violent society with a far more brutal culture (if we can even call it that) ever since its foundation based on genocide of the indigenous population of the land, which nowadays finds expression in phenomena such as school shootings and serial killers, phenomena which happen to be either completely nonexisting or comparatively extremely rare in Iran.
And you still haven't provided any evidence for the suggestion that intended homicide rates are more or less identical in the two countries, so this is just speculation on your part. The initial point will stand in either case: whether due to liberal gun laws or not, reality is that Iran is a much safer place than the US when it comes to the probability of getting murdered or to getting subjected to assault, and that's what ultimately matters. If the Americans could lower their murder rate to Iranian levels by revising gun laws, which I doubt, it's their fault not Iran's if they don't.
The figures in the first link show significantly superior levels for various forms of crime in the US. Those relative to murder do not seem to be accurate though, since America's' intentional murder rate is more than twice as high as Iran's. The numbers I showed were from 2017 for the US and 2014 for Iran, but in actually since then homicides have recorded a sharp increase in America from around 16.000 to over 20.000. It's doubtful that it rose as much in Iran. So if anything, the intentional murder rate in the US should be more than two and a half times that of Iran, and closer to thrice as high. Such an ample variation likely cannot be explained by the prevalence of firerarms alone.
The second link does not even show its sources, and its so-called crime index appears to be based on surveys, so that can be skipped.
The fact that security levels vis a vis crime for ordinary citizens in America are significantly worse cannot be denied.
As for subjective perceptions and fear of crime, this is due in Iran's case to the mind-boggling amount of propaganda and psy-ops the Iranian people are subjected to from the largest mainstream and specialized media apparatuses in the world, like user MyNamesNotJeff correctly evoked. Had Americans been conditioned by adverse propaganda to remotely comparable degrees, in all probability they would no longer dare to leave their homes.