Is it good to use MacBook while plugged in?

I read on the internet that this even extends battery health, is that true or not?