Are parentheses allowed within a G-code comment?
This is not universally valid G-code, and how it is handled depends on the implementation. You can use this style of comment on some machines, but not all.

The way parsing used to be implemented in Marlin (a very common 3D printer firmware), it would work fine unless the comment string included a X, Y, Z, E or F character. The parser simply looks for the first occurrence of X/Y/Z/E/F and then tries to parse the bit of text appearing after that character into a number. If the string cannot be parsed as a number, it defaults to 0 instead. For example,

 G0 (Some comment containing the character Y) Y10 Z-5


would be interpreted as G0 Y0 Z-5 and not as G0 Y10 Z-5, because ") " (the string appearing after the first occurrence of "Y") does not parse to any valid number. Your example happens to work fine because the comment string doesn't contain any special characters.

Marlin does support end-of-line comments, which should start with a semicolon and continue until the end of the line.

This is how it used to work in older Marlin versions. Newer Marlin versions have a more advanced parser, but it still would not play well with these parentheses-style comments. It is best to avoid them, as compatibility is not guaranteed.