It is not true regardless of what internet nonsense you may have read.
No bear wants a fight, they want to be left alone.
Polar bears are dangerous and in very rare, specific circumstances some brown bears may consider you a food source, but they are not interested in slowly killing you or eating you alive. 🤭
As for black bears, they are about as dangerous as a racoon. The reason you rarely see them is that they are absolutely terrified of huge bipedal humans and will almost always run away well before you even knew they were there.
I ran into a habituated black bear just after sunset while I was by myself hiking in the Smokies one time. He followed me for 10-15 minutes until I finally turned around and went right at him. He took off at that point but he did have me ready to jam a hickory walking stick right down his snout.