In compiled non-esoteric languages a solution is essentially always either a full program, a method, or a lambda expression. In a full program submission, the use of comments is clearly allowed. It's not clear to me, however, whether comments should be permitted in lambda submissions, which must be expressions, or method submissions. (This tends to come up in certain restricted-source challenges.)
Strictly speaking, in Java, comments are a source-level concept and aren't part of the language's grammar, which suggests to me that source code that contains comments cannot represent an expression or even a method definition. I suspect that other similar languages are defined similarly.
It could be said that a submission is acceptable if stripping comments out (as the compiler does) yields a valid expression/method. Yet a trailing line comment can affect the parsing of the program a lambda solution is embedded in if the submission doesn't end with a newline. This too seems a bit suspect to me.
Still, for the most part lambda and method submissions with comments seem intuitively acceptable. This is neither a pressing issue nor a particularly profound one, but it nags at me when I visit many restricted-source challenges. I'm interested to see what others think.
Update: I've added an answer. If you have an opinion on this issue, consider voting on my answer and/or adding an alternative one.