Setting a dynamic views exposed filter can be done via hook_form_FORM_ID_alter() regularly if it's just a prepopulation of the views exposed filter form.
But if you wish to immediately run the filters using better_exposed_filters auto-submit when the view is loaded you have to use hook hook_views_pre_build(). Otherwise setting the #default_value is just too late.
Use the following code:
/**
* Implements hook_views_pre_build().
*/
function MYMODULE_views_pre_build(\Drupal\views\ViewExecutable $view) {
$view_ids = ['your_view_name'];
$filterValueToSet = 'myfiltervalue';
if (in_array($view->id(), $view_ids)) {
// Prevent caching may be a good idea:
\Drupal::service('page_cache_kill_switch')->trigger();
$exposedInput = $view->getExposedInput();
if (empty($exposedInput['my_exposed_filter_name'])) {
$view->setExposedInput(['my_exposed_filter_name' => $filterValueToSet]);
}
}
}
}
?>