I believe your comments should not be of the type that give away a strategy the opponent may not have figured out. (Ex. - "I see you're looking to mate on the Queen's side...") Perhaps a note of encouragement to whichever player you think made a good move might be OK.
Generally, though, I would stay away from making comments at all.
Does it violate some code to comment on a game you're observing? Its allowed evidently. Suppose its a match of a chess.com friend and you say something like, "Looks like he's playing a modern defense."