Brain barrier ekak tiyenawane man danne hariyata.
Yes.. there is the Blood-Brain Barrier (BBB), but there are many pathogens that can cross it. Briefly these use three mecahnisms - Transcellular, Paracellular and the Trojan Horse mechanism.
The therapeutic drugs use the Trojan Horse approach where the drug is fused with a molecule that's able to pass the blood–brain barrier via a transporter protein.
Also note that the brain is protected by the immune system and also regulates the immune system for the rest of the body too.