For manifolds with boundary, there are two different types of "connected sums". On the one hand, there is the notion of "boundary connected sum", where one takes two manifolds with boundary $\mathcal{M}$ and $\mathcal{N}$ and cuts out two open balls living in $\partial\mathcal{M}$ and $\partial\mathcal{N}$ and glues the resulting boundaries together. The resulting manifold is denoted by $\mathcal{M}\#_{\partial}\mathcal{N}$ and fulfils $\partial (\mathcal{M}\#_{\partial}\mathcal{N})=\partial\mathcal{M}\#\partial\mathcal{N}$.
On the other hand, I can define the connected sum of two manifolds with boundaries $\mathcal{M}$ and $\mathcal{N}$ by cutting out two open balls living in the interior of $\mathcal{M}$ and $\mathcal{N}$, with the property that their closure does not intersect the boundaries. The resulting manifold, denoted by $\mathcal{M}\#\mathcal{N}$, has the property that $\partial (\mathcal{M}\#\mathcal{N})=\partial\mathcal{M}\coprod\partial\mathcal{N}$.
Now, suppose I take one manifold with boundary $\mathcal{M}$ and one manifold without boundary $\mathcal{N}$. My question is, if in this case it is also allowed to choose the ball in $\mathcal{M}$ such that its interior of the ball is in the interior of $\mathcal{M}$, but its closure intersect the boundary of $\mathcal{M}$.
I ask this question, because in a lecture, we took a manifold $\mathcal{M}$ with boundary and were cutting out a ball touching the boundary and were then performing the connected sum with a sphere. It was then claimed that the restuling manifold is homeomorphic to $\mathcal{M}$. When choosing $\mathcal{N}=S^{2}$ and $\mathcal{M}=\overline{D}$, where $\overline{D}$ is the disk, I easily can see why this is true, but I would like to know if this is allowed in general...