None of my many HK P7's ever gave truly impressive groups. I was disappointed at the "legendary" accuracy they were supposed to have. They are a great gun though!
The Glock is not a target gun, but no one says it is not accurate either. The beauty of the Glock shows when you pull it from leather and make fast defensive hits with it. The trigger is GREAT for that purpose. Other guns that excel at target shooting really fall behind against the timer from a holster. That is why I see so many Glocks in my IPSC competitions these days. They are great from the holster, and that can be a great thing. If you want a target gun, then don't get a combat gun. Figure out what your priorities are.
That said, I am a pretty good shot, and having owned all of the above said guns, I never found one that showed any more accuracy than another across the board. I would honestly say that HK's, Sigs, and Glocks and everything else I have tried print exactly the same groups. It just depends more on what you shoot better. I have never been able to determine that one brand is totally more accurate than another. I plan to try a real custom 1911 soon though, one that probably can do 1" at 25 yards. Maybe THEN I will finally see a real accuracy difference, but between all the combat gun brands mentioned I have had some guns that were more accurate than others but I honestly don't think that any one of the brands is more accurate across the board.
For instance, my Glock 30 and my Glock 32 print groups that my Sigs and HKs could only DREAM about. I shoot my Glock 31 out to over 200 yards offhand and hit a torso easily. I am not going to name numbers here (like X inches at 25 yards) but let me just say that none of my other brand guns are any more accurate than that.
The Glock is just as accurate as you are with it. Some people never get the hang of the trigger, or never get proper training to learn how. If you really want to make your Glock accurate, get some good training and practice dry firing a lot.