You cannot use HTML comments anywhere here on Stack Exchange. Comments such as
<!-- filler --> are sometimes used in answers and questions to bypass character limits, but get removed in the final output. Only some HTML is allowed in posts, the rest all gets filtered out.
If you think this should be allowed, you need to fill out a detailed reason why you think you should be able to do this, file a feature request, and let the community downvote it into oblivion.
As per your example, it is finding the
<!-- <br> first because the Markdown system doesn't care about your HTML comment. They're not allowed, so it doesn't search for the closing
-->. It just sees that
<!-- <br> looks like an HTML element, it's not allowed, and thus it gets removed.
Actual HTML source:
<pre><code>The first one <!-- this is the comment --> the second one <!-- this is the second comment >-->
<p>Result: The first one the second one --></p>
Notice the lack of actual, physical HTML comments in the source of the document.