Not really true, unless you are comparing a very poorly chosen rifle load to a well chosen pistol load. Almost any of the great 5.56/.223 defense loads offer reduced penetration through building materials and lower risk of harm from a projectile that exits the body of your attacker, because the high velocity and relatively fragile nature of the bullets means that they break apart very easily when hitting almost any kind of barrier. After a few inches of penetration in a person they fragment and by the time they exit on anything but a surface wound, the small, rapidly decelerating bits won't have enough mass or velocity to pose a significant threat.