Finite p-groups and their fibered products Is every finite $p$-group an epimorphic image of a fibered product of two finite $p$-groups which can be generated by $2$ elements?
 A: No, you cannot obtain all finite $p$-groups in this way; you even miss some $p$-groups of nilpotency length 2 (although you have all abelian $p$-groups as I mentioned in a comment).
Lemma: Let $G$ be a fibered product of $G_1$ and $G_2$. Let $L$ be a subgroup of $G$ both of whose projection on $G_1$ and $G_2$ are onto, and let $N$ be the normal subgroup of $G$ generated by $L$. Then $G/N$ is abelian.
Proof: Let $G$ be fibered product of $G_1\stackrel{f_1}\to H\stackrel{f_2}\leftarrow G_2$. Let $K_i$ be the kernel of $f_i$. Let $p$ be the projection $G\to G/N$. It follows from the definition of $N$ that $p(K_1\times K_2)=G/N$. So to show that $G/N$ is abelian, it is enough to show that $p(K_1)$ is abelian, i.e., $p([K_1,K_1])$ is abelian. If $u,v\in K_1$, let $w$ be an element in $G_2$ such that $(v,w)\in L\subset N$. Then
$$p([u,v],1)=p([(u,1),(v,w)])=[p(u,1),p(v,w)]=[p(u,1),1]=1.\qquad\Box$$
To apply the lemma in your context, assume that $G_1$ and $G_2$ are generated by $k_1$ and $k_2$ elements (you have $k_1=k_2=2$ but the argument is more general). Then we can find $L$ as in the lemma, generated by $k=k_1+k_2$ elements (actually we could even do $k_1+k_2-s$ where $s$ is the minimal number of generators of $H$). Hence there exist $s$ elements in $G$ ($s=4$ in your case) such that the quotient of $G$ by the normal subgroup generated by these $s$ elements is abelian.
It is thus enough to find a $p$-group in which this does not hold. For instance, if we take a free group on $c$ generators in the variety of 2-nilpotent groups of exponent $p$ (exponent 4 if $p=2$) then it works: such a group is thus not (a quotient of) a fibered product of 2 2-generated groups if $c$ is large enough (namely $c\ge 6$), because its quotient by the normal subgroup generated by 4 elements is never abelian.
Edit: here's a proof of the latter fact (for odd prime $p$): the truncated Baker-Campbell-Hausdorff formula yields an equivalence between the categories of 2-nilpotents Lie algebras over $\mathbf{Z}/p\mathbf{Z}$ and 2-nilpotents groups of exponent dividing $p$. In the free 2-nilpotent Lie algebra $\mathfrak{f}$ on generators $X_1\dots,X_n$ (and over any field), the ideal generated by $X_1,\dots,X_k$ is spanned by $X_1,\dots,X_k$ and $[X_i,X_j]$ for $i\le k$ and $j\le n$; its intersection $W_k$ with $[\mathfrak{f},\mathfrak{f}]$ thus has dimension $f(k)=k(k-1)/2+k(n-k)$. Note that by construction, $f(k-1)+1\le
 f(k)$ for all $1\le k\le n-1$, because $[X_{k},X_{k+1}]\in W_k\smallsetminus W_{k-1}$. In particular, $f(k)<f(n)=\dim(\mathfrak{f})$ whenever $k\le n-2$, and $f(k)+s\le f(k+s)$ whenever $0\le k\le k+s\le n$. Now consider a subspace $V$ of dimension $m$ in $\mathfrak{f}$. Let $s$ be the dimension of its intersection with the derived subalgebra $[\mathfrak{f},\mathfrak{f}]$ and $k=m-s$, so $k$ is the dimension of the projection to the abelianization. Then up to an automorphism of the $\mathfrak{f}$, we can suppose that $V$ contains $X_1,\dots,X_k$, and hence if generated by those elements and $s$ elements of the derived subalgebra. So the ideal generated by $V$ has dimension $\le f(k)+s$, which is $\le f(k+s)=f(m)$ as we have seen. Thus if the ideal generated by $V$ contains $[\mathfrak{f},\mathfrak{f}]$ then $f(m)=n$, which implies $m\ge n-1$; in other words, the quotient of $\mathfrak{f}$ by any ideal generated by $\le n-2$ elements is non-abelian (of course it's optimal since killing $n-1$ canonical generators yields a 1-dimensional Lie algebra). 
All these facts carry over to the group, because the equivalence of categories is the identity on the underlying sets: namely given odd $p$ and an 2-nilpotent $p$-group, there is a canonically defined addition and Lie algebra law yielding the group law by the Baker-Campbell-Hausdorff formula $(gh=g+h+(1/2)[g,h])$ and Lie subalgebras (resp ideals) coincide with subgroups (resp. normal subgroups), so the minimal number of generators in either sense is the same as a group or subalgebra, resp. as a normal subgroup or ideal. Of course another approach is to convert the previous proof to the group setting, which should not be hard, and would allow to encompass the case of 2-groups.
