Insert region into html.html.twig
So, the solution is to add a new region into your theme.info.yml (say before_body)
Then the code you'd place into theme_name.theme be:

function theme_name_preprocess_html(&amp;$vars) {
  /**
   * moves region before_body into before_body var inside basic html
   */
  if (isset($vars['page']['before_body'])) {
    $vars['before_body'] = $vars['page']['before_body'];
}
function theme_name_preprocess_region(&amp;$vars){
  /**
   * Cleans before_body from standard html markup
   */
  if ($vars['region'] === 'before_body') {
    $vars['content'] = theme_name_clean_special_content($vars['content']);
  }
}
/**
 * Cleans content from basic markup
 * @param $content
 * @return \Drupal\Component\Render\MarkupInterface|string
 */
function theme_name_clean_special_content($content) {
  /** @var \Drupal\Core\Render\Markup $content */
  $content = preg_replace('~&lt;\/?section.*?&gt;|&lt;h\d?.*?&gt;.*&lt;\/h\d?&gt;|&lt;\/?div.*?&gt;~', '', $content);
  $content = preg_replace('/(?=&lt;!-- (THEME DEBUG|BEGIN OUTPUT|THEME HOOK|FILE NAME SUGGESTIONS|END OUTPUT))([\s\S]*?)--&gt;/i', '', $content);
  $content = preg_replace('/((\r\n|\n|\r)$)|(^(\r\n|\n|\r))$/m', '', $content);
  return \Drupal\Core\Render\Markup::create(trim($content));
}


Just don't forget to add before_body variable into your basic html template.