From Controller to html.twig I have a module that define a Routing and a controller 

my.partner:
  path: '/partner/{alias}'
  defaults:
    _controller: '\Drupal\myname\Controller\PagesController::partner'
    _title: 'Partner'


In controller I define the template to use:

$variables = [
         '#theme' =&gt; 'page_partner',
]....


But I need to pass some "variables" from this "controller" to html &lt;head&gt;. How can I do it ?
Define the variables in your theme and the pass them as "#variable" = value. E.g. in YOUR_MODULE.module have something like:

function tb_megamenu_theme($existing, $type, $theme, $path) {
  $items['tb_megamenu'] = [
  'template' =&gt; 'tb-megamenu',
    'variables' =&gt; [
      'menu_name' =&gt; NULL,
      'content' =&gt; NULL,
      'section' =&gt; 'frontend',
      'block_theme' =&gt; \Drupal::config('system.theme')-&gt;get('default'),
    ],
  ];
}


In your controller use:

$render = [
  '#theme' =&gt; 'tb_megamenu',
  '#menu_name' =&gt; $this-&gt;getMenuName(),
  '#block_theme' =&gt; $this-&gt;getThemeName(),
  '#content' =&gt; $this-&gt;getContent(),
];