Alternatives to themekey?
You can easily recreate your required feature by implementing a custom theme negotiator. This requires a little custom programming.

First, create an own module (in the following example, we'll call it mymodule). Within that module, create a mymodule.services.yml file, that lets Drupal know about your theme negotiator service:

services:
  mymodule.theme_negotiator:
    class: Drupal\mymodule\Theme\MyModuleThemeNegotiator
    arguments: ['@request_stack']
    tags:
      - { name: theme_negotiator, priority: 1000 }


The important parts here are the service tag theme_negotiator and a high enough priority, that ensures the negotiator will be called before any other negotiators. If you want to just change the default theme dynamically but let route specific theme negotiators still apply, use a priority &lt; 0.

As you can see, we also mentioned your custom theme negotiator service class MyModuleThemeNegotiator located in the namespace Drupal\mymodule\Theme, and as argument the current request stack (as we can use it to get the request headers).

So let's create a folder src/Theme in your module and add a MyModuleThemeNegotiator.php like this:

namespace Drupal\mymodule\Theme;

use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Theme\ThemeNegotiatorInterface;
use Symfony\Component\HttpFoundation\RequestStack;

/**
 * My Custom Theme Negotiator.
 */
class MyModuleThemeNegotiator implements ThemeNegotiatorInterface {

  /**
   * The request stack.
   *
   * @var \Symfony\Component\HttpFoundation\RequestStack
   */
  protected $requestStack;

  /**
   * Constructs a MyModuleThemeNegotiator object.
   *
   * @param \Symfony\Component\HttpFoundation\RequestStack $requestStack
   *   The request stack.
   */
  public function __construct(RequestStack $request_stack) {
    $this-&gt;requestStack = $request_stack;
  }

  /**
   * {@inheritdoc}
   */
  public function applies(RouteMatchInterface $route_match) {
    // This method must return TRUE, if your headers
    // fulfill the desired requirements.
    if (
      $this-&gt;requestStack-&gt;getCurrentRequest()-&gt;headers-&gt;has('myheader')
      &amp;&amp; $value = $this-&gt;requestStack-&gt;getCurrentRequest()-&gt;headers-&gt;get('myheader')
      &amp;&amp; $value == 'myvalue'
    ) {
      return TRUE;
    }

    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function determineActiveTheme(RouteMatchInterface $route_match) {
    // This method returns the ID of the theme that shall be
    // used, if your theme negotiator applies.
    return 'mytheme';
  }
}


Alter the header/values to match your requirements, clear your caches, and your theme should be applied.