I think Nines secretly hates Hank. He sees him walking through the DPD, narrows his eyes and hisses to himself, "I can't stand it," and goes on with his day. It has a lot to do with the overprotectiveness he has of Connor. Although there is a rivalry between them, Nines secretly views Connor as a brother, and vice versa. He thinks Hank isn't enough for Connor and thinks he could get someone better.
Nines really doesn't usually treat him badly. He generally ignores him in the DPD and avoids him in meetings. There is a silent limit that the two have agreed upon: not to speak to each other. It works for them to ignore each other most of the time and that's fine with them. Hank agrees to not get along and Nines couldn't be happier to see Hank stumble.
However, the friction between them at some point collapses. Nines realizes that Hank really is good for Connor and tries to remove the smokescreen. They begin to talk to each other, to treat each other, little by little they begin to have a friendship and, without realizing it, they become friends.
Nines would send him embarrassing photos of Connor and say embarrassing things about him to make him laugh. Hank told him funny stories about Connor and sent him videos of dogs. And it works. They get along well.
Over time, Hank would take a liking to him and include him in his life. And vice versa.
Connor couldn't be happier about it. Although he is not her brother, she feels like one and is happy that he gets along with her boyfriend.