Take $M = X$ and $f=p$, so that $\underline{P} = \underline{X} \times_\mathcal{D} \underline{X}$. The Lie groupoid $P\rightrightarrows X$ you get should be proper, in the sense the source-target map $(s,t)\colon P\to X\times X$ is a proper map, and $(s,t)$ should be injective, so that there are no nontrivial automorphism groups. Then your original stack is the stack associated to the manifold that is the quotient of $X$ by the equivalence relation corresponding to $P$ (which is closed, by properness of $(s,t)$), i.e. $\mathcal{D} \simeq \underline{X/P}$.
To respond to the question about non-injectivity of $(s,t)$ in the comments:
Let us say that the groupoid $P \rightrightarrows X$ has some pair $x,y\in X$ are such that $(s,t)^{-1}(x,y)$ has at least two distinct elements, say $a$ and $b$. Then note that $id_x$ and $b^{-1}a$ are distinct elements in $(s,t)^{-1}(x,x)=\mathrm{Aut}(x)$. Then consider the groupoid of functors $\ast \to (P\rightrightarrows X)$ and natural isomorphisms, which is equivalent to the groupoid of functors $\ast \to \mathcal{D}$ (this is because every principal $(P \rightrightarrows X)$-bundle over $\ast$ has a section - this is a nice exercise to work out the details). But by Yoneda the groupoid of functors $\ast \to \mathcal{D}$ is equivalent to the groupoid $\mathcal{D}(\ast)$, thinking of $\mathcal{D}$ as a functor $\mathbf{Mfld}^\mathrm{op}\to \mathbf{Gpd}$. But in the groupoid of functors $\ast\to (P\rightrightarrows X)$ the functor sending $\ast$ to $x\in X$ has a nontrivial automorphism, given by $b^{-1}a$, so the groupoid $\mathcal{D}(\ast)$ has an object with a nontrivial automorphism, hence $\mathcal{D}\colon \mathbf{Mfld}^\mathrm{op}\to \mathbf{Gpd}$ doesn't factor through $\mathbf{Set}\hookrightarrow \mathbf{Gpd}$. Every stack arising from a manifold is in fact a sheaf $\mathbf{Mfld}^\mathrm{op}\to \mathbf{Set}$, so in this case $\mathcal{D}$ cannot be the stack associated to a manifold. Hence for $\mathcal{D}$ to come from a manifold, $(s,t)$ must be injective. This is not sufficient, one really does need properness else the quotient $X/P$, which should be the manifold in question, will not exist in $\mathbf{Mfld}$. Consider for instance the action groupoid associated to a free action of $\mathbb{R}$ on a torus $U(1)^2$ with irrational slope.