Is it ok to shampoo hair the day after dying it?

I'm dying my hair blue black permanently and I was wondering if it's going to affect anything if I shampoo it the day after? Will a lot of the color run out?