The temperature dependences of the resistivity, magnetoresistance and the Hall effect of ZnO thin films doped with Ga and Al were investigated at low temperatures. According to obtained experimental data the dimensionality of the investigated films with respect to the weak localization theory changes from 2D to 3D with an increase of magnetic field and temperature. To describe the observed negative magnetoresistance under these conditions we derived a new expression for the weak localization correction to the conductivity. It was found that the obtained expression describes magnetoresistance of investigated films much better than all known expressions for negative magnetoresistence related to weak localization. The values of the electron diffusion length during the phase relaxation time of wave function were obtained by fitting of experimental magnetoresistance with derived expression. Obtained values are consistent with the applied approach.