Assume that $(X,O)$ is a ringed space and fix $x\in X.$
Let $\mathfrak{m}$ be a maximal ideal in $O(X),$ such that $\mathfrak{m}_x:=\mathfrak{m}|_{O_x}$ is maximal in $O_x$.
Question. Does $\mathfrak{m}/\mathfrak{m}^2\cong \mathfrak{m}_x/\mathfrak{m}_x^2$?
I am not much of algebraic geometer so I apologies ahead, if there is some major flaw in my question. Be understanding and write me a comment, if there are errors.
I added complex-analysis tag, cause I believe that the answer is NO. Example I have in mind is the ringed space of holomorphic functions with ideal consisting of functions vanishing at a point. However I can't prove that it is a good example.
Let $X=\{0,1\}$, topologized such that $\{0\}$ is open by $\{1\}$ is not. Let $k$ be your favorite field, and define a sheaf of rings on $X$ by $\mathcal{O}(X)=k[x]$ and $\mathcal{O}(\{0\})=k$, with the restriction map sending $x$ to $0$. Then the maximal ideal $\mathfrak{m}=(x)\subset\mathcal{O}(X)$ has $\mathfrak{m}/\mathfrak{m}^2\cong k$ but $\mathfrak{m}_0/\mathfrak{m}_0^2=0$ since $\mathfrak{m}_0=0$.
(Replacing $k[x]$ by a local ring, we can even get a counterexample for a locally ringed space.)