From Itō isometry Wikipedia page:
Can we switch the expectation and integral in the RHS by Fubini's theorem?
I'm actually not quite sure how Fubini's theorem is used outside basic Calculus.
The fact that my professor did not discuss Riemann integration of a random variable suggests that it is possible otherwise the $\int_0^T X_t^2 dt$ probably wouldn't make sense.