Technically, yes, plants produce chemicals with fungicidal properties, but I think you are referring to something more along the lines of anti-spore? Like an apoptotic?
I realize this, and yet these plants do produce some type of moldicide. Some to greater or lesser degrees than others. The question is: WHAT is this chemical? I'm guessing nobody actually knows.
Notice that landraces that are native to altitude [thin air, low humidity] usually make dense tight buds, while lowland races [humid thick air] usually have airy buds. Natural and human selection. -granger
Quite a few terpenes have been shown to have fungicidal properties (e.g. thymol and carvacrol). I daresay there are numerous chemical defenses for molds.
I've had great results against mold adding silica to my nutes or soil, silica helps to build strong cell walls, increasing resistence against infections ....thanks to crazy composer for the info