For the brain is it unhealthy to have anesthesia?

No, not when the... Anesthesia is properly administered by a trained anesthesiologist or crna. General anesthesia today is much safer than in the past, and most of the agents used are very short acting. All vital signs are continuously monitored during almost all anesthetic administrations and complications are extremely rare.
Not really. The extremes of age, that is to say the pediatric patient or the geriatric patient, have great sensitivity to the anesthetics. There is a possible link to cognitive disfunction in these groups from anesthesia. This relationship has not been found in the normal population.