Rendering plain HTML in a form
If this was just content I would replace #markup with #prefix. It will automatically render without escaping your HTML.

However, it seems like you don't just want to render this HTML. You actually want it to interact with the Drupal Forms API. As such, I would recommend that you parse the data you need from the source and construct the form element the recommend way: 

form['example_select'] = [
  '#type' =&gt; 'select',
  '#title' =&gt; $this
    -&gt;t('Select element'),
  '#options' =&gt; [
    '1' =&gt; $this
      -&gt;t('One'),
    '2' =&gt; [
      '2.1' =&gt; $this
        -&gt;t('Two point one'),
      '2.2' =&gt; $this
        -&gt;t('Two point two'),
    ],
    '3' =&gt; $this
      -&gt;t('Three'),
  ],
];