How to use Drupal 8 ajax API for Menu links
You can try this for adding 'use-ajax' class to menu link:

/**
 * Implements hook_menu_links_discovered_alter().
 */
function MYMODULE_menu_links_discovered_alter(&amp;$links) {
  if (isset($links['MENU_LINK_ID'])) {
    $links['MENU_LINK_ID']['options']['attributes']['class'][] = 'use-ajax';
    $links['MENU_LINK_ID']['options']['attributes']['data-dialog-type'] = 'modal';
  }
}