Pecking order begins from day one in the brooder together. At times there are adjustments - needed and made, like if a member is removed or new members added, if a member is sick, broody or becoming aged to the point of not being able to hold onto their spot. Also, as cockerels mature into roos and pullets get closer to laying age there is some shuffling on the pecking order done.
The flock as a whole has a pecking order, with the alpha rooster at the top. Any other rooters will be at the bottom, below the hens even. In addition to that main pecking order, roosters have a seperate pecking order amongst themselves.