What the dog is smelling
Dogs can be trained to detect the odor of actively growing mold. As mold grows, it releases microbial volatile organic compounds, or MVOCs — airborne gases produced by that growth. Those compounds can move through porous building materials such as drywall and wood, so the odor may be present in a room even when the growth itself is concealed, including in wall cavities or under flooring.
A dog inspection is a search for odor. It is not a laboratory test, and it does not, by itself, identify the type or amount of mold.