The reason Rock/HBK never happened is simple timing.
That's got nothing to do with the heat that they had for a very long time though, which was very real, and speaks a lot to both HBK's general attitude as well as his paranoia for holding onto his top spot. What I'm posting here is information gathered from the web, as well as various autobiographies of wrestlers from that time.
Their heat began when Dwayne Johnson was a teenager in Hawaii. Sound far fetched? You bet. But as the story goes, the man who would be known as the Rock felt that a young Shawn Michaels was disrespectful to his grandmother Lia Maivia at a Polynesian Pacific Pro Wrestling show (first the Rocks grandfather Peter Maivia and later after his passing, Lia ran that promotion). It was something he never forgot (who would forget the guy who was a jerk to their grandma?), so years later when he joined the WWF, he already wasn't a fan of Shawn Michaels.
After the Rock had joined the WWF, both Michaels and Triple H had a serious hate for the kid. Part of that was that he was so talented that they were worried that he would eventually take the top spots that HBK currently had, and Triple H hoped to later have. For anyone skeptical of this because 1996/97 Rocky Maivia was the drizzling shits? True, but no matter how green the guy was, people in the business were ridiculously high on Rocky, and even back then was being pegged as the guy who was going to carry the company.
The other part of why they hated the Rock? Because Bret Hart liked him and took him under his wing somewhat, and in the WWF back then, that was all it took for someone to earn the wrath of the clique.
Since both HBK and HHH were on the booking committee back then, they cooked up a spot shortly after Hart's heel turn. HBK told Vince McMahon that Hart should beat Maivia for the Intercontinental belt, while HHH insisted to Hart that he beat Rocky for the belt. They felt that this would serve three purposes. Derail Rocky's push, and get Hart out of the World title picture, which Michaels wanted to be back in. Then later, when HHH booked himself to win the IC title from Hart (since he was on the booking committee), the win would help make HHH even bigger.
The problem was, that Hart refused to go along with it, and convinced McMahon to let him only beat the Rock by DQ. Shortly after, they did have Rocky drop the title to Owen Hart, and looking back now, it's doubtful that the clique's plan to sabotage the Rock would have worked (he came back shortly after the Owen loss in his new character anyways). But that's where the heat between the two came from. HBK went from just being the guy who was a jerk to his grandma, to also being the guy who tried to ruin his career. So later on, the Rock simply didn't have time for Michaels whenever he was around. He went on record stating that he didn't want to work with him. He told Bret Hart later on that he should come back to the WWF and not to worry about Michaels, because it was guys like the Rock and Austin on top now, and they wouldn't let Michaels get away with anything. There was that one time on Smackdown where it looked like a Rock/HBK program was going to start, but then HBK just disappeared.
Had HBK not dropped out of wrestling during the Rock's peak performing years, I'm sure they would have worked together. Rock and Triple H did famously, and Triple H had as much to do with trying to hold Rocky back in his early days as HBK did. They even sorted things out somewhat. But I think since HBK wasn't there, that the resentment the Rock felt for him just grew, because they didn't have the chance to work things out. I guess they're fine with each other today though.