Let manifold $S$ (connected, without boundary) have next property: for every submanifold $D \subset S$ (connected, compact, without boundary), every homeomorphism $f:D \to D$ extends to a homeomorphism $g: S \to S$.
What do we know about these manifolds? Can they have dimension 3, for example? For instance, we can assume $S = \mathbb{R}, \mathbb{R}^2, S,S^2$ (line, plane, circle, 2sphere) and we cannot assume $S = \mathbb{R}^3$.
1 Answer
I seem to have misunderstood the question. I left my original answer (which answers a different question) below, and added an answer to the actual question at the top.
Answer to the actual question: In dimensions 3 and higher, the answer is no for topological embeddings (as asked in the question). Consider the Alexander horned sphere (see Rolfsen's book for a nice exposition) which for $n\geq 3$ is an embedding of $S^{n1}$ in $S^n$ that is not locally flat at some points, and locally flat at others. A locally flat submanifold $X^k$ of $Y^n$ is one such that for every point $p\in X$ there is a neighborhood $U \subset Y$ with $(U, U \cap X) \approx (R^n,R^k)$. Let us call such a neighborhood a local product neighborhood. Alexander's original construction was in $S^3$ but the same idea works in any dimension.
Since every $n$manifold $M$ contains a copy of $R^n$, you can find an Alexander horned sphere in every $M$. For any two points $p,q$ on the sphere $S^{n1}$, there is a homeomorphism $f:S^{n1} \to S^{n1}$ taking p to q. Embed $S^{n1}$ in $M$ as a horned sphere, and choose $p$ to be a point where the embedding is locally flat and $q$ to be a point where the embedding is not locally flat. Then there is no homeomorphism of $M$ to itself extending $f$, because such an extension would take a product neighborhood of $p$ to a (nonexistent) product neighborhood of $q$.
If you want your ambient manifold and submanifold to be smooth, then this argument doesn't work, as smooth submanifolds are automatically locally flat. In that case, you could use a nonreversible, nonamphicheiral knotted sphere of codimension $2$ as in the argument I suggested below. In that case the homeomorphism of the submanifold would be a reflection.
Original answer: I'm going to rename your manifold $S$ to $M$ to distinguish it from a sphere. Let's assume that your manifold $M$ has finitely generated fundamental group and dimension $n \geq 3$. This will hold if, for instance, $M$ is closed. By the Grushko Decomposition Theorem, $\pi_1(M)$ decomposes as a free product of groups $A_1*A_2* \cdots A_r*F_s$ where $F$ is free, and none of the $A_i$ is cyclic or decomposes as a free product. This decomposition is unique up to permuting the factors.
Choose two knots $K$ and $K'$ in the 3sphere such that the fundamental groups of their complements are different, and neither is isomorphic to any of the factors in the above decomposition of $\pi_1(M)$. Then there are knots $J, J'$ in $S^n$ with such that $\pi_1(S^nJ) = \pi_1(S^3K)$ and likewise for $J', K'$. Now insert these knots $J, J'$ into a ball in your manifold $M$. Then no homeomorphism $J \to J'$ will extend to a selfhomeomorphism of $M$, because the fundamental groups of the two complements are different using the argument in the next paragraph.
The fundamental group argument: $\pi_1(M J) = \pi_1(M) * \pi_1(S^nJ)$, and likewise for $J'$. By the asphericity of knot complements in the 3sphere, the knot groups are indecomposable with respect to free product. By the hypotheses and Grushko's theorem, any isomorphism $\pi_1(M J) \to \pi_1(M J')$ would induce an isomorphism $\pi_1(S^n J) \to \pi_1(S^n J')$, which we assume can't exist.

$\begingroup$ Thanks for your answer! I'm a firstyear student, thats why I dont understand more of your arguments. But as I understand, you build homeomorphism between different knots $J$ and $J'$ which are not equals and homeomorphism between $J$ and $J'$ does not extends to homeomorphism $M \to M$. But in start post I require, that every homeomorphism $D \to D$ be could extends (i.e., in your designations, I want that $D=J=J'$). Or I misunderstood you? $\endgroup$ Jun 27, 2014 at 19:30

$\begingroup$ Oh, I think I misunderstood your question. I will amend my answer; I'm not sure I've followed the right protocol here. $\endgroup$ Jun 28, 2014 at 12:23