The Markdown implementation in Discourse does not require to add a space after a # to convert to header. The problem with this behavior is that you cannot easily use # in your text, which is now pretty popular (even just for fun, without real tag management like on FB).
Other implementation like GitHub or Zendesk make the difference between the two cases: #discourse > #discourse # discourse > #discourse