There are similarities
The Wikipedia article on foreskin states...
Eight weeks after fertilization, the foreskin begins to grow over the head of the penis, covering it completely by 16 weeks. At this stage, the foreskin and glans share an epithelium (mucous layer) that fuses the two together. It remains this way until the foreskin separates from the glans.
However... that statement comes with a "medical citation needed".
So I looked some more and found this...
FORESKIN RETRACTION
Separation of the foreskin from the glans penis occurs by desquamation and begins late in gestation, but remains incomplete in most male infants at birth. Only approximately 4 percent of males have a completely retractable foreskin at birth, and in more than half of newborn males, the foreskin cannot be retracted far enough to visualize the urethral meatus.
After birth, penile growth and physiologic erection aid in the desquamation process and the formation of keratinized pearls (smegma) between the layers, which loosens the adhesions and allows retraction of the preputial skin.
So it seems that — kind of like with nails — the foreskin and the glans do stick together in infant boys and requires desquamation to allow retraction of the foreskin. If this anything like getting a nail pulled is hard to know since no infant has ever been able to compare and describe the two kinds of experience, but boys will — eventually — go through separation of the foreskin from the glans.