In Drupal 8, we have a contributed module that name is "Selective Better Exposed Filters". That is to show only used taxonomy terms or categories in view exposed filters.
https://www.drupal.org/project/selective_better_exposed_filters
But it will depend on the better_exposed_filters module.
https://www.drupal.org/project/better_exposed_filters
better-exposed filters (selective) module will enhance the exposed form style. you have to enable it in exposed form, check the box "show only used terms" at the bottom.
If you have multiple exposed filters then you will have to enable them individually under the "more options for".
Note: If have any suggestions or issue regarding 'How to show only used taxonomy terms or category in view exposed filters?' then you can ask by comments.