More information about the chemistry behind can be found in the article “Chemistry in the dyeing of eggs” (Journal of Chemical Education, 1987, 291). The article discusses anionic dyes with sulfonate groups. These bond to the cuticle (protein) covering the egg shell forming salt linkages as shown (illustrated using FD&C yellow no. 6):

By lowering the pH (for example by adding vinegar), more amino groups in the proteins covering the egg shell are protonated and thus available for formation of the salt linkages with the anionic dyes.