You can escape everything inside the comment.
Within the comment, <
becomes <
and >
becomes >
.
Here is the link to escape characters reference - https://developer.mozilla.org/en-US/docs/Glossary/Character_reference
Here is an example -
<html>
<body>
<p>This is a paragraph</p>
<!-- This is a <!-- problem comment --> comment -->
<!-- This is a <!-- fixed comment --> comment -->
</body>
</html>