How can I access the main menu in template_preprocess_page?
Remember your menu can be a block, and to render it, you just have to load and get its view in a preprocess function.

THEME.theme file  

use Drupal\block\Entity\Block;
function THEME_preprocess_page(&amp;$variables) {
  $menu = Block::load('id_main_menu');
  $variables['main_menu'] = \Drupal::entityTypeManager()-&gt;getViewBuilder('block')-&gt;view($menu);
}


page.html.twig

...
{{main_menu}}
...


Attention
You must create your block 'main_menu' in somewhere, (module install, block structure page...)