Can we define a 'rectangular coordinate' on a curved surface? We use rectangular coordinate on a flat plane, so can we use it in a curved surface, like the axis is somehow bent?
If yes, is there any application? Also, can we generalize this to higher dimension?

Assume we have a parametrized surface (patch) given by $S:[0,1]^2\rightarrow \mathbb R^n$ and we are looking for a reparametrization function $\varphi:[0,1]^2\rightarrow [0,1]^2$ so that
$$\langle \partial_x (S\circ \varphi),\partial_y (S\circ \varphi)\rangle=0,$$
which expresses this perpendicularity claim you are looking for. At some point $p\in[0,1]^2$, this can be written as
$$0=\langle D_pS\cdot \partial_x\varphi, D_pS\cdot \partial_y\varphi\rangle
=\langle\partial_x\varphi,\underbrace{(D_pS)^\top D_pS}_{:=A_p}\cdot\partial_y\varphi\rangle
=\langle\partial_x\varphi,A_p\cdot\partial_y\varphi\rangle
=\langle\partial_x\varphi,\partial_y\varphi\rangle_{A_p}.
$$
So we are looking for a diffeomorphism $\varphi:[0,1]^2\rightarrow[0,1]^2$, so that its partial derivatices are perpendicular with respect to the above defined dot product using $A_p:=(D_pS)^\top D_pS$.
I do not know enough about those differential equations to tell you anything about its solution or even if there are any. But this would be my way approaching it.
