Update on 13 Nov 2023: There’s a much simpler method here. But the following is still useful to get an understanding of how query loops in Bricks work.
This Pro tutorial provides the steps to set up nested query loops in Bricks with a Posts query inside a Terms query for showing posts grouped by their categories.

This method can be applied to show posts of any post type grouped by a corresponding taxonomy (built-in or custom), not just posts and categories.
In this example, we are showing post titles linking to their permalinks. Since we aren’t using a Code element for outputting the loops we have full flexibility to visually develop the loop content by placing the various elements that Bricks builder provides.
Step 1
Copy and paste the Section from our test site using this JSON.

For the outer loop Block, the query type is set to Terms → Categories.

For the inner loop Block, the query type is set to Posts.

Step 2
Add the following in child theme‘s functions.php or a code snippets plugin:
// Set the category of the inner query loop element when it is looping to its outer query loop's term.
add_filter( 'bricks/posts/query_vars', function( $query_vars, $settings, $element_id ) {
// ensure that this is your inner query loop element
if ( $element_id !== 'tuqwcb' ) {
return $query_vars;
}
// get the nearest or current looping query's ID
// since the inner query loop element's query runs for each iteration of the outer Terms query loop, this will be the query ID of Terms query loop.
$looping_query_id = BricksQuery::is_any_looping();
// get the term ID
$looping_object_id = $looping_query_id ? BricksQuery::get_loop_object_id( $looping_query_id ) : 0;
// get the object type
$looping_object_type = BricksQuery::get_loop_object_type( $looping_query_id );
if ( $looping_object_id > 0 && $looping_object_type === 'term' ) {
$query_vars['cat'] = $looping_object_id;
}
return $query_vars;
}, 10, 3 );
Replace tuqwcb with the Bricks ID of the inner loop element.
If you’d like to use this for posts (of any post type) for a taxonomy (usually, custom) replace
$query_vars['cat'] = $looping_object_id;
with
$query_vars['tax_query'] = array(
array(
'taxonomy' => 'product_cat',
'terms' => $looping_object_id,
'include_children' => false,
)
);
Replace product_cat with your taxonomy.