How do I use block_view_alter for the template file? I want to alter a view block. I used hook_block_view_alter(), but this is not working in a template theme Drupal 8.

How do I use hook_block_view_alter() in template theme?
I think from the *.theme file you should use hook_preprocess_HOOK