The Arithmetical Hierarchy is an example where one in mathematics uses aligned subscripts and superscripts. When writing in Latex I e.g. write $\Pi^1_1$ to talk about a certain class of formulas. How can I achieve this in Word or LibreOffice?
Yes it's certainly possible with LibreOffice.
In LibreOffice Writer, click
In the window that opens at the bottom type in the formula as follows
LibreOffice also comes with a separate Math application, which can also be used to create formulas. There's further documentation here on the using formulas in Math in LibreOffice https://wiki.documentfoundation.org/images/3/37/MG40-MathGuide.pdf