Yes, you can do that. It will be difficult to slide the peep with the string under tension, but I've done it before. Pressing the limbs just a bit makes it much easier.
Changing the peep's height will also change its rotation, and it may not be properly aligned with your eye at full draw after you make the height adjustment. After getting the height right, you can twist/untwist the string a half-twist at a time to get the peep alignment close to where it needs to be then move individual string strands from one side of the peep to the other to fine tune the alignment if necessary. Adjusting string twists and moving strands requires a bow press.