Love it. Once you put aside the fact that they both love Emma, they were friends and Hook was willing to become a father figure to Bae when Bae stowed away on the Jolly Roger and he found out that he was Milah's son. I feel like the hug is his way of saying that he is sorry for everything.
Hagrid is SO SO SO severely underrated. It kinda pisses me off, to be honest. He is one of the truest, most loving and innocent characters in the entire series. He deserves so much more appreciation than what he receives.