As long as the postpartum strength is restored, it is ok to take a bath and wash your hair, usually after one week, but pay attention to wind and warmth, bacterial infection, etc. Careful nursing will not be a problem.
The reason why many treasure mothers struggle to wash their hair is that they don't clean up their personal hygiene when they have children, so many puerperal fever cases occur.
As long as you do a good job of cleaning and ensure that you don't catch cold, you can wash your hair during confinement.