Hello dear,
You are correct regarding the fact that inadequate hydration status &
hypoxia (inadequate
oxygen supply to the brain) can cause headache.
But please remove all myths & misconceptions from your mind about
masturbation.
In fact, Masturbation is completely normal & doesn't have any bad effect to the body and mind.
Headaches can also be due to:
1. Stress
2. Sinus infection
3. Migraine
4. Any fluctuation in blood pressure levels, etc.
Investigations like X ray of paranasal sinus,
complete blood count & estimation of blood pressure levels will be helpful.
You can ask me any further query on this website using the below link: http://www.healthcaremagic.com/doctors/dr-polash-sannigrahi/64925
There is no need to worry, you will be fine.
Best thing is to eat a healthy diet, exercise regularly, avoid stress, get good sleep, think positive and stay happy.
Wishing a good health.
Take care.