Yeah but beer and cheese are fermented by fungi also bread.
Correct. Yeast is not bacteria. I have good sanitation practices to keep bacteria OUT of my beer when brewing. For that matter, hops themselves have anti-bacterial properties.
That said, there are a few beers that use bacteria (e.g., lactobacillus) in a controlled way to produce specific styles.