Set posts per page for parent category and it’s all children

You want get_term_children.

function hbg_category_query( $query ) {
  if( $query->is_main_query() && $query->is_category()) {
    $categories = get_term_children(1,'category');
    $categories[] = 1; // add your special category

      if (is_category($categories)) {
        $query->set( 'posts_per_page', 32 );
      }
  }

  return $query;
}
add_action('pre_get_posts','hbg_category_query');

Barely tested, but I think that will work.