Let $G$ and $K$ be (possibly non-Abelian) groups and let $\phi:G\rightarrow K$ be a homomorphism. Let $\bar{G}$ be a group containing $G$ as a subgroup.
Is it always possible to extend $\phi$ to a homomorphism $\bar{\phi}:\bar{G}\rightarrow K$ (such that $\bar{\phi}$ restricted to $G$ is $\phi$ itself)? If not what conditions are required for this to be true?
I have seen somewhere that for the Abelian case if $K$ is divisible this is possible but I'm mostly interested in the non-Abelian case.
Is it always possible to extend $\phi$ to a homomorphism $\bar{\phi}:\bar{G}\rightarrow \bar{K}$ where $\bar{K}$ is some group containing $K$ as a subgroup? If not what conditions are required for this to be true?