Alternate of using "delivery callback" $items['mymodule/%user'] = array(
  'title' =&gt; 'My Module',
  'page callback' =&gt; 'mymodule',
  'page arguments' =&gt; array(1),
  'access arguments' =&gt; array('access user profiles'),
  'type' =&gt; MENU_CALLBACK,
  'delivery callback' =&gt; 'mymodule_ajax_callback',
);


Above code is from D7, I've used "mymodule_ajax_callback" as my "delivery callback" in D8 but I'm unable to find a way.

Tried finding solution here Structure of routes but I'm unable to get the solution.
You are looking for responses. For example, in a controller, you can return a renderable array, a Symfony Response object, or specific responses (AjaxResponse, JsonResponse) to respond to the request. 

For example, AjaxResponse in the docs, and here is an example of a controller responding with it:

https://www.mike-miles.com/blog/creating-ajax-callback-commands-drupal-8