Passing variables between sibling blocks Is there any possibility to use "entry" from the for-loop inside the "main" block inside another block ("header" in my case)? See example below:    

{% extends "main" %}
    {% block header %}
        {{ entry.id }}
    {% endblock %}

{% block main %}
    {% for entry in craft.entries.section('blogPosts').limit(5).all() %}
    {% endfor %}
{% endblock %}
I don't understand what you want to achieve? In your example, the for loop would run 5 times so which entry.id do you want to get out?

The way to use common variables in both your blocks would be to do:

{% extends "main" %}
{% set entries = craft.entries.section('blogPosts').limit(5).all() %}

{% block header %}
    {% for entry in entries %}
        {# access entries in here #}
    {% endfor %}
{% endblock %}

{% block main %}
    {% for entry in entries %}
        {# and also in here #}
    {% endfor %}
{% endblock %}