Parsoid can serialize HTML to wikitext. So, if we are able to use a 3rd party library to parse markdown to clean HTML, we could then use Parsoid to then serialize that to valid wikitext.
(The other direction: wikitext -> HTML -> markdown might be harder!)
One could then imagine editing gadgets that lets editors add content in markdown and have it saved as valid wikitext.
This would be an interesting project in its own right but it would also help us identify gaps in our serialization code in terms of handling HTML that is not Parsoid-generated.