"It's part of play." Indeed it is.
Once again - all animals, including humans, play to develop adult skills in environments where the risks of failure are low. That is essentially what play is, and why so much of it is imitative, especially in young children.
So the question then is, are you happy with the skills your child is practising? It's very true, for example, that some gun play could be seen as training for adult life, in very "pro-gun" cultures. That's fine, as long as you are happy with the outcome of that - i.e. your child is literally practising, not just the techniques, but the emotions and attitudes that surround the use of firearms. Such play tends to be responsible and based around respect of the weapon. This is the same as children in the Middle Ages being given a toy sword, or children today being given a doll; they are rehearsing for a key part of their future adult life.
Some gun play, on the other hand, is entirely removed from these responsibilities. Cowboys and Indians has been mentioned a lot here.
When most of us were growing up and playing cowboys and Indians, or cops and robbers, our chances of ever meeting someone who owned and used a real gun for anything other than hunting or poaching were slim indeed. The game, therefore, though a bit "wrong" when you think about it, didn't really matter. In the same way, playing with a light sabre is violent; but, as your chances of meeting a Jedi knight are slim, the line between fantasy and reality is pretty clear.
Now that, in some parts of the country, children own guns and use them on other children; and now that, even in the UK, the sight of police carrying firearms is much more common; I think the stakes are a bit higher, personally.