Given an arbitrary Riemannian manifold $\mathcal{M}$ with metric $g$, is it always possible to choose a diffeomorphism $\phi:\mathcal{M}\rightarrow\mathcal{M}$ such that the pullback $\phi^*g$ is flat?
If not, is it at least possible locally on some open set of $\mathcal{M}$? What if I only consider 2D manifolds?
It is not always possible. There are some topological obstuctions. The Euler class of a closed manifold endowed with a flat metric vanishes identically. So for example the sphere $S^2$ cannot be endowed with a flat metric.