Can I call a dynamically named variable through twig? I am using Craft 3 with the Commerce 2 plugin.

I am trying to dynamically call a variable in a twig template where this variable has to be a "placeholder" for a handle of a field inside a block inside a matrix field.

Here is an example snippet which visualises my problem:

{# 'product' variable is passed to this template #}

{% set fields = product.productFields %}
{% set categoryOptions = [] %}
{% for cats in fields.type('categories') %}
    {% for category in categories.fieldLayout.fields %}
        {% set categoryOptions = categoryOptions|merge([category.name]) %}
    {% endfor %}
{% endfor%}

{% set productId = product.id %}
{% for catOption in categoryOptions %}
    {# Here is where I try to call catOption as a 'placeholder' #}
    {% set productId = productId~ '-'~ categories.(#{catOption}).label %}
{# I have also tried using:
{catOption},
catOption,
#{catOption} etc but nothing seems to work #}
{% endfor %}


Usually I could call the 'categories' one by one but I want everything to be dynamically set.

I know that in some languages you can call a function/property like that or assign a variable with such value. 

Any suggestion for a solution or a workaround would be useful. Thank you in advance!
Unless I'm misunderstanding, the title of your question is a bit misleading as you're not trying to call a Craft function in Twig, you're trying to output a dynamically named variable (a variable variable).

You can generally do that using the array syntax: e.g. categories[catOption].