If you leave wooden pegs outside in the rain, mould will eventually form on the surface, leaving black stains on your clothes when you hang them on the washing line.
To prevent staining, place the “dirty” pegs on the inside of the garments. At least, if the peg stained the fabric, it won’t be seen from the outside. Have you had a look at my post on how to hang clothes?
If you always leave your pegs outside, maybe you should invest in plastic ones instead. At least, mould does not grow on them.
However, it is possible to remove mould from wooden pegs. Submerge the pegs in a bleach solution for a couple of hours and use an old toothbrush to scrub the bits touching your clothes. But beware! Make sure that the pegs are throroughly rinsed afterwards otherwise, you might end up with discoloured/bleached marks on your garments, which would look just as bad as black marks!