..are comments where someone suggests using ChatGPT to write their code allowed?
Pointing someone to a specific tutorial or API documentation page is great in a comment, but asking someone to Google their question is almost always discouraged (even if you offer to write the search terms yourself).
ChatGPT isn't significantly different from a search engine (except, perhaps, that it doesn't always cite its sources). While not strictly against the rules, I would strongly encourage users not to recommend ChatGPT unless the question is specifically about AI, etc, and ChatGPT would be relevant to the question.
Or put another way: if you could copy-paste the comment onto just about any other randomly selected question, then it's probably not a useful comment.
What is the policy regarding this?
The current ChatGPT policy is for copying content from ChatGPT and offering it as your own answer:
the posting of answers created by ChatGPT is substantially harmful to the site and to users who are asking and looking for correct answers.
Mentioning ChatGPT in a comment does not, strictly speaking, run afoul of this specific policy. However, comments mentioning ChatGPT aren't therefore exempt from all of our other comment policies. I think the most relevant is the one linked above regard LMGTFY
Should I flag the comment?
In this case, for the sake of efficiency, probably not.
Questions like this one are of such low quality that they are unlikely to have a very long life on SO. Nearly all other moderation efforts are moot if the author doesn't bother to write a question that will survive closure and eventual deletion (the only exception to my mind being unkind/abusive comments, where the comment author may need correction more than the question author).
Obviously you are thinking beyond this particular question, in which case the policy on telling users to "Google it" is, I think, most relevant:
Personally I'd flag such comments as not constructive.
The comment is indeed not helpful, not to the OP and not to future visitors. Either show how googling it would have found the information, or not comment at all.
We no longer have the "Not Constructive" category, so "It's no longer needed" would be the nearest corollary (""This comment is outdated, conversational or not relevant to this post."")