This isn't going to be an answer that most people like, but most games are by design not designed to do this, but it is pretty easy to remove the safety on most games and make this happen. It's just, you probably don't want to do it.
Star Wars for example is a setting where weapons more advanced than modern weaponry exist, and yet lightsabers and enraged unarmed Wookies and even hordes of Ewoks with clubs are more powerful in the stories than those advanced weapons. If you want genre verisimilitude, you need to tone down non-melee weaponry and favor melee combat because that's what happens on screen.
The same is true of just about any genre of game you want to play. Guns only kill bad guys in most stories, and heroes are reduced to fists. Star Trek? Kirk does his two-handed fist hammer smash more often than he shoots someone with a phaser. James Bond? Never is taken out by a sniper with one shot, but always gets into hand to hand with a henchmen or thug.
But I can easily take something like 3e D&D or a generic D20 game and if I want to add modern weapons to it in a way that overshadows melee. You just take normal melee weapons in that genera and give them increased to hit bonuses, slightly higher damage, increased rates of fire, improved range increments compared to other missile weapons, improved critical ranges, and make them easy weapons to acquire skill in. You won't necessarily impact the game much until you start simulating 18th century tech, and you won't change the world until you have at least mid-19th century tech, but by the time you have 20th century tech suddenly 1st level orcs or goblins are a serious threat to 8th or 10th level fighters.
And that is the problem with advanced weaponry. Heroes depends on having greater defense than the offensive power that can be brought to bear by mooks. Heroic is all about in some fashion being able to defend yourself. And in a world with machine guns, grenades and artillery you are in a world about armies and not about individuals. Random death becomes too likely of an outcome. There is a reason that you don't have 105mm and 155mm howitzer shells raining down on the PCs in games, because it's solely luck whether you survive that. High tech guns are fundamentally that same problem. If you introduce realistic guns you are going to find the need for advanced armor, luck or destiny points to alter random outcomes, force fields, plot protection, or precognitive reflexes and the ability to dodge and block bullets. Or else, you are going to have stories that don't simulate the arc of the stories people tell.