Search entries by matrix field
You could loop through the Matrix field on every entry save using the awesome Preparse plugin, to store the categories an entry contains in a new field.

https://github.com/aelvan/Preparse-Field-Craft

Here’s example code for your Preparse field, it would store strings like firstCategory,thirdCategory,secondCategory.

{%- set categories = [] %}

{%- for block in entry.myMatrixField.type('myRelevantBlockType') %}
    {%- if block.myDropdownField %}
        {%- set categories = categories|merge([ block.myDropdownField.value ]) %}
    {%- endif %}
{%- endfor %}

{{- categories|join(',') -}}


Once you have populated that field for all your entries, you can filter them by a category using this criteria model.

{% set categoryToSearch = 'secondCategory' %}

{% set entries = craft.entries({
    section: 'myEntriesSection',
    search: 'myPreparseFieldHandle:*' ~ categoryToSearch ~ '*',
}) %}


I have to say that I’m not very proud of this solution as it uses search which I usually try to avoid. But I wasn’t able to come up with a better idea.