const data = Object.entries(сюда кидаете свои данные);
const years = Array
.from(new Set(data.flatMap(n => Object.keys(n[1].G))))
.sort((a, b) => a - b);
const columns = Array
.from(new Set(data.flatMap(n => Object.values(n[1].G).flatMap(Object.keys))))
.sort();
<TableHead>
<TableRow>
<TableCell rowSpan={2}>regions</TableCell>
{years.map(n => <TableCell colSpan={columns.length}>{n}</TableCell>)}
</TableRow>
<TableRow>
{years.flatMap(n => columns.map(m => <TableCell>{m}</TableCell>))}
</TableRow>
</TableHead>
<TableBody>
{data.map(([ region, { G } ]) => (
<TableRow>
<TableCell>{region}</TableCell>
{years.flatMap(n => columns.map(m => <TableCell>{G[n]?.[m]?.value ?? 0}</TableCell>))}
</TableRow>
))}
</TableBody>