Hagrid respected Dumbledore for a variety of reasons - 1. He had known Dumbledore for over 50 years. read more
Considering they both work at Hogwarts, that’s a lot of time spent together. So of course, Dumbledore has gained Hagrid’s respect. He’s been a good boss to him for 50 years. 2- Dumbledore’s trust. Although Hagrid was expelled from Hogwarts and banned from using magic, Dumbledore still trusted Hagrid with a job at Hogwarts. read more
You know that Hagrid will publicly defend you. You know that Hagrid will cry like a baby if he gets emotional. So in that, Dumbledore knew that he could trust Hagrid with his life because Hagrid's pattern dictated that he would do everything he could to remain loyal and fulfill his duties. read more