On harnack type inequalities and their application to quasilinear elliptic equations