I agree, I don't think that looks like Yellow Fungus, at least I don't see any "scabby" areas like you usually see with Yellow Fungus. The orange area definitely isn't Yellow Fungus, it's a stain from something, like the piece of wood or if he was kept on sand the same color, etc. He does however have several yellow blotches in other places, which hopefully are just more stains or retained shed, but I would definitely give him a warm
bath, and if you have a soft toothbrush, after he soaks in the warm water for 5-10 minutes then use the soft toothbrush to gently try to clean the stained and/or retained shed areas from him. I think it all will end up either washing off of him, or eventually shedding off if it's retained shed that got stuck, which often has a "yellow" color to it. If it doesn't all come off then you just want to watch it and make sure that new yellow spots don't develop, or that the current spots don't start spreading, getting larger, or become "scabby" looking, as those are all signs of a fungal infection. Also keep in mind that there are hundreds of different strains of fungal infections that reptiles can develop, not just Yellow Fungus, so even if he does have a fungal infection it's not necessarily Yellow Fungus.
As far as how they get fungal infections, well, there are a ton of different ways, it's just like trying to determine how a person gets a fungal or bacterial infection, most of the time you just don't know. The best ways to keep a Bearded Dragon from getting any types of fungal or bacterial infections is to use only a solid substrate in the bottom of his tank, never use any loose substrates like sands, wood chips, bark, beddings, etc. that breed and harbor all types of microbes and parasites; Keep his tank clean by removing any bowel movements or excess food or dead insect parts and then spot cleaning those areas with a vinegar/water solution, and then completely disinfecting his entire tank and everything in it at least once a month with a proper Reptile disinfectant, like F10, or with vinegar/water or bleach/water, and also keeping his tank very dry by wiping up any water spills that may happen inside the tank, and by completely drying your dragon off after baths.
Also, there's nothing at all wrong with finding tank decor like pieces of wood, rocks, stones, etc. outside or in thrift shops at all, but as AHBD already instructed, they have to be properly disinfected first, and you do that by putting them in an oven that has been pre-heated to 250 for about 30-45 minutes. Obviously you can't do this with plastic decor, but I get most all of my tank decor outside in the woods, along local river banks and lakes/ponds, the ocean/beach, etc. Any type of wood or stone that is porous can be made completely safe this way. I actually first soak/wash/rinse my wood and rocks in the bathtub when I first bring them home, in a mixture of extremely hot water and then something like F10, bleach, or vinegar, and scrub them to get all the dirt and muck off of them, then I bake them.