Knuckles and Sonic have a weird relationship. They started out as rivals, because Robotnik tricked Knuckles into believing Sonic was after the Master Emerald, and Knuckles tried to do what he could to stop him. They then became allies with a common enemy, Robotnik. Much to the annoyance of Sonic, they keep ending up on opposite sides because of Knuckles' gullibility. I think Sonic sees Knuckles as a friend, though. They team up again and again, and Knuckles was invited to Sonic's birthday party in Sonic Generations.
Sonic and Knuckles pick on each other a lot. They call each other names, and point out each other's weaknesses. Sonic's favorite name for Knuckles is Knucklehead. I think their playful banter is just part of their friendship, stemmed from their previous rivalry.
I wouldn't consider the two best friends, or even good friends, as I don't think they'd call on each other if they needed one another. They're both too stubborn for that, and they both think they can handle everything on their own. When their paths coincide, however, they are happy to work together.