Yes, that can be done. You can create a table in the script that has the dimension names in a field and let the user select one value from that field. That value can be used as a dimension in your chart with an expression like =$(='[' & only(DimensionListField) & ']')
Actually it's probably easier to create the dimension as a field in the table you create from the excel data:
LOAD *, 'MyDim1' as Dimension
FROM MyExcelFile.xlsx (ooxml, embedded labels, table is SheetX);
LOAD *, 'MyDim2' as Dimension
FROM MyExcelFile.xlsx (ooxml, embedded labels, table is SheetY);
Then you can simply put the field Dimension in a listbox.
It may be even more convenient to add the Dimension field to the tables in Excel.