If you're referring to games, yes that is true as very few developers are actually knowledgeable about how firearms and bullets actually work.Handguns always do more damage than rifles, because of the larger diameter bullet. If you're designing a round for close use, the handgun or shotgun are better than the rifle.
The difference in effectiveness in combat between rifle and pistol is not in the round. It's in the fact that you tuck a rifle into your shoulder so it creates a much more stable firing platform. The best closest quarters weapons are sub-machine guns, which fire pistol rounds full auto from a platform tucked into the shoulder, and often with so little power you'd be astonished, in order to make them subsonic and therefore quiet. The power is primarily in the platform, not the ballistics. SMGs recoil less in game and are a great choice for the multi-tool guy.
Example, an AR-15 chambered in 6.5 Grendel; this round has a slightly larger diameter than the .223 but with 2-3 times the mass and comparable velocity, causing it to have noticeably greater energy at the muzzle than a .454.
However, it is unlikely any military will use 6.5 Grendel in an M-4 type weapon as it'd be too problematic to control in burst or auto for most people.