Is Bernoulli's theorem valid for viscous liquid?

No, it should be modified to take into account the work done against viscous drag.