$\require{AMScd}$Here are two results about groups:

(**The third isomorphism theorem**) Suppose that I have $A \triangleleft B \triangleleft C$ and $A \triangleleft C$. Then $C/B \cong (C/A)/(B/A)$.

(**An exercise I just assigned my students**) Suppose that we have $X \triangleleft Z$ and $Y \triangleleft Z$ with $X \cap Y = 1$. Then $(Z/X)/Y \cong (Z/Y)/X$.

Vague question a student just asked me: Is there some general context in which to think of these results and why they look similar?

We can write these as diagrams with exact rows and columns: \begin{gather} \begin{CD} @. @. 1 @. 1 \\ @. @. @VVV @VVV \\ 1 @>>> A @>>> B @>>> B/A @>>> 1 \\ @. @| @VVV @VVV \\ 1 @>>> A @>>> C @>>> C/A @>>> 1 \\ @. @. @VVV @VVV \\ @. @. C/B @>\cong>> (C/A)/(B/A) \\ @. @. @VVV @VVV \\ @. @. 1 @. 1 \end{CD} \\ \begin{CD} @. @. 1 @. 1 \\ @. @. @VVV @VVV \\ @. @. X @= X \\ @. @. @VVV @VVV \\ 1 @>>> Y @>>> Z @>>> Z/Y @>>> 1 \\ @. @| @VVV @VVV \\ 1 @>>> Y @>>> Z/X @>>> (Z/X)/Y \cong (Z/Y)/X @>>> 1 \\ @. @. @VVV @VVV \\ @. @. 1 @. 1 \end{CD} \end{gather} If we were in an abelian category, these would be two forms of the octahedral axiom.

Vague but more technical question: Is there something like a semi-abelian category which includes the case of groups, and where we have something like an octahedral axiom?

it fundamentally uses it, and (b) you used the lattice isomorphism theorem to write it in a "slicker" (but technically incorrect) manner. What I mean is that $X$ is not a subgroup of $Z/Y$ so $(Z/Y)/X$ literally makes no sense. Making things technical, you are claiming $(Z/Y)/(XY/Y) \cong (Z/X)(XY/X)$, which is a simple consequence of (two applications of) the 3rd isomorphism theorem. [Of course, you are correct that $XY/Y\cong X$ when $X\cap Y=1$, etc...] $\endgroup$4more comments