Generalized Jacobson's lemma for Drazin inverses and its applications