Is it true that any finitely presented group can be realized as fundamental group of compact 3-manifold with boundary?
[Math] Fundamental group of 3-manifold with boundary
fundamental-groupgt.geometric-topology
Related Solutions
Related to question (1), suppose you wanted to get a 4-manifold with boundary as a submanifold of $\mathbb{R}^4$ with fundamental group a finitely presented group, with presentation complex $K$. It is a result of Curtis that any 2-complex $K$ is homotopy equivalent to a 2-complex which embeds in $\mathbb{R}^4$ (see also the Stallings reference in the comment on this MO question and Dranishnikov-Repovs - in fact this works if the 2-complex $K$ has only one vertex). However, to thicken up $K\subset \mathbb{R}^4$ to get a tubular neighborhood which is a 4-manifold (with boundary) in $\mathbb{R}^4$ which retracts to $K$, $K$ must be nicely embedded. For example, the 2-cells should be locally flat. I'm not sure if this holds true for the embeddings of Curtis or for the other constructions.
To answer (2), think about what happens when you thicken up the complex. Thickening some points in $\mathbb{R}^5$ gives some 5-balls, whose boundary is a union of 4-spheres. Thickening an interval attached to some points, one gets a 1-handle $D^1\times D^4$, whose boundary removes two 4-balls from the 4-spheres and attaches in $D^1 \times S^3$, giving a 4-manifold with free fundamental group (a connect sum of $S^3\times S^1$'s). The 2-cells thicken up to 2-handles $D^2\times D^3$, which remove $S^1\times D^3$ from the 4-manifold (which doesn't change the fundamental group, since $S^1$ is codimension 3), and replaces it with $D^2 \times S^2$, which has the effect of killing the element in the free group corresponding to the circle by Van Kampen. So you see that this gives the same thing as the construction in Henry Wilton's answer to the other question.
No, the answer is negative in general (if you require $M$ to be compact). $M$ comes with a map $M \to BG$ that is, by definition, $n+1$-connected (iso on $\pi_i$ for $i=0,...,n$, epi on $\pi_{n+1}$). You can turn it into a weak equivalence by attaching cells of dimension $\geq n+1$. From that you see, that there is a model for $BG$ having finite $n$-skeleton. This is a special property of a group that is called $F_n$ (for more information, see http://berstein.wordpress.com/2011/03/16/morse-theory-finiteness-properties-and-bieri-stallings-groups/). Finitely presented groups are $F_2$ and you find that a necessary condition on your $G$ is that it is of type $F_n$. The are concrete examples of groups that are $F_i$ but not $F_{i+1}$ for each $i$, which are discussed in same blog post (on page 423 in Hatcher's AT, you find the same examples in a slightly different context).
On the other hand, let $G$ be $F_n$ and let $K$ be the $n$-skeleton of $BG$; a finite complex. Then I claim there is a closed manifold $M$ with the desired properties. $M$ can be chosen of arbitrary dimension $d \geq 4,2n+1$ and to be stably parallelizable. Start with a sphere $S^d \to K$ and do surgery on $S^d$ to get rid of the homotopy groups in low dimensions. The precise formulation is for example Proposition 4 in Kreck's paper "Surgery and duality".
So we can say that a necessary and sufficient condition is that $G$ is of type $F_n$. Caveat: I might have confused $n$ and $n+1$ at various places.
If you want to have $dim M \leq 2n$, you meet a new obstruction enforced by Poincare duality and things become really difficult.
Best Answer
A couple of extra points.
Any compact 3-manifold with boundary $M$ can be doubled to give a closed 3-manifold $D$. As $M$ is a retract of $D$, it follows that $\pi_1(M)$ injects into $\pi_1(D)$. Therefore, any "poison subgroup" (such as the Baumslag--Solitar groups that Autumn mentions above) applies just as well to compact 3-manifolds as closed 3-manifolds.
Other classes of poison subgroups can be constructed from cohomological conditions. The Kneser--Milnor Theorem implies that any closed, irreducible 3-manifold with infinite fundamental group is aspherical. It follows that any freely indecomposable infinite group with cohomologial dimension greater than 3 cannot be a subgroup of a closed 3-manifold (and hence of a compact 3-manifold, by the previous paragraph).
EDIT:
Oh, and yet another source of poison subgroups comes from Scott's theorem that 3-manifold groups are coherent, meaning that every finitely generated subgroup is finitely presented. This rules out subgroups like $F\times F$ (where $F$ is a free group), which is not coherent.