It depends where you are and what your goal here is I guess.
Many fungi are thought to be present latently in trees, waiting for the perfect conditions to germinate, so the identification of a fungus may not mean that much.
Not all fungi are ‘bad’ for your plants either, so a blanket test for ‘any’ fungi will also be meaningless if it was possible.
You can however, have samples of leaves/bark/wood/fungi etc examined and microscopically inspected to identify certain fungi if needed (here in the uk anyway) if you need a positive id for any reason, for instance identifying Ganoderma to species level, to aid in assessment and prognosis of decay in trees.