Yes taking cold showers when you can does help build up your immunity and helps to boost your bodies natural immune system.
The cold water helps by stimulating and constricting and dilating your bodies blood vessels, which strengthens your immune system.
Warm showers can also boost your immune system as well so you can alternate between cold and hot showers if you want to relax your muscles and boost your bodies immune system.
I take cold showers more often in the summer months but in the wintertime I mostly take warm or hot showers.