I'll give our hens pets when they're wandering around and when they submit. I, too, like having them used to submitting when I stand over them just in case I need to pick them up. And they get the most pets when the hop up on us for "lap time." They'll happily snooze on a leg for 5-10 minutes.
As far as being pecked goes, if one is really being aggressive, we have found poking them is the most effective response. Not hard, just a quick jabbing tap in the neck or the ribs. They don't like that. Only a couple of times has one gotten so aggressive (chasing/pecking the one on the "bottom" in an aggressive manner) was warranted a swat on the beak. But that's only happened a couple of times. In general we try not to interfere with the pecking order much. But (there is no rooster) we are on the top of it. Granted these are NOT aggressive breeds (barred rock, RIR) so your mileage may vary.