|MadSci Network: Biochemistry|
The simple answer here is microorganisms in this case fungi and bacteria. The limiting nutrient to growth in most systems is water. There is no life without water and there never would be without its presence on this planet. So when things get covered in water we have our first requirement for life. Now all we need is some form of nutrient (food). Well in the bath you use soap, what is soap? Well its a mixture of things, but its basic component is glycerol, a substance you yourself can use as a food. It's only the presence of other things (SDS among others) that make it non-taste friendly. So we have the bases for growth of a microorganism. But which microorganisms? Well generally a wide range of bacteria and fungi that are present in the air and water. The colouration is a pigment they produce to protect themselves from uv light (a bit like sunscreen), among other uses, and the slime is a means of protection from drying out. As for the dog. Well saliva is rich in protein-carbohydrates (mucus) which acts as food again.
Try the links in the MadSci Library for more information on Biochemistry.