If the brain damage that occurred after the lack of oxygen wasn't too severe then yes sometimes the brain can heal itself after the brain damage due to lack of oxygen.
However if the lack of oxygen caused too much brain damage then the brain damage may not be reversible and cannot be repaired.
When someone is unable to breathe and lacking oxygen it's very important to start CPR and get the person breathing as soon as possible.
Also immediately call 911 or seek medical attention if someone stops breathing because the brain cells can begin to die within 5 minutes without oxygen getting to the brain.
Sometimes brain damage can be reversed on it's own as long as the brain wasn't damaged too bad and then if the brain completely dies then someone could be brain dead or be in a vegetable like state.
The brain is elastic and is amazing and can do wonderful things so yes sometimes the brain can heal and repair itself after a temporary lack of oxygen but not if the oxygen levels got way too low.