Recently Vladimir Kramnik accused Hikaru Nakamura of cheating in online chess. He Tweeted : "It is impossible to imagine a player to be allowed to wear headphones during a game of chess." Or somethings along the lines of that. But is it actually illegal on chess.com? And also, are the FIDE rules forbidding it?
Rule 9.7 states that "Players are not allowed to have headphones in or over their ears during play."
I think that should clear any doubts in your mind. I have also personally played a couple of online chess events and I can definitely say that under no circumstances are you allowed to wear headphones during the match.
As in Hikaru's case, he is basically chess.com's main display man, so I can see why chess.com wouldn't mind him doing whatever he wants. You could say that chess.com literally doesn't care.