Fungi, like animals, are heterotrophs, which means that they need to consume another organism in order to obtain their energy and nutrients.
Autotrophs, such as plants, are organisms that can utilize energy from a primary energy source and process nutrients in the environment in their raw form. They are the basis of a food chain and nothing can exist without them. If there are no plants then there needs to be some other type of autotrophic organism for the fungi to feed on.
My understanding is that we only know of two autotrophic mechanisms: photosynthesis which uses light and chemosynthesis which uses chemicals. So the pickings are slim unless your world has naturally occurring methane oceans and oxygen or something like that with which energy can be extracted from (which would probably count as chemosynthesis).
I think most examples of chemosynthesis that we have found are closely tied to geothermal energy, but my understanding is that these organisms use the chemicals from the geothermal vents rather than the heat from the vent itself. Theoretically, I suppose an organism could evolve to directly use the heat differential from the geothermal energy and I guess these would be thermotrophs. I guess the same is also theoretically possible from the decay of radioactive materials which would be radiotrophs I guess.