Yes Hashirama participated to war , but if never United Kingdom had not let independance to India , we be sure that an military conflict would be arised between Indian independantist and United Kingdom.
Madara wanted destroy Konoha so kill women , children ect... . Hashirama is pacifist but he has his limits , no one can attack the village and his people , it's logic that Hashirama protect his family , he consider the village as his family and a Kage must protect his village.
It's justly the pacifism's limit , ok to be pacifist and call to the peace it's good , but when someone want do bad thing , you can't let do this person.
If Britain would have genocided the Indian people to keep the Indian territory, i don't think that Gandhi would not agree for a military ripost. I don't say that he would take Weapons , but if Indian would take weapon , he would a litle agree .