It's been a while since I've used deal.II so this is my recollection.
If Wolfgang Bangerth or one of the other developers says otherwise you should listen to them.
What deal.II does is add continuity constraints to hanging nodes of the (non-conforming) mesh at the linear-algebraic level.
So rather than solve a linear system involving the usual stiffness matrix for, say, the Poisson equation, some of the rows of that matrix are modified after assembly in order to ensure that the hanging nodes linearly interpolate the values on either side.
There's a nice figure illustrating this in the deal.II documentation.
It can be difficult to ensure that adding these constraints doesn't destroy the conditioning of the linear system, so I think there's a bit of re-scaling that happens as well.
The naive thing would be to make one equation equal to $u_i - (1 - \alpha)u_j - \alpha u_k = 0$ where $u_i$ is the hanging node, $u_j$, $u_k$ are its neighbors, and $\alpha$ is the fractional distance of $u_i$ between $u_j$ and $u_k$.
Instead, they scale this equation by whatever was in the diagonal of the matrix originally.
Anecdotally, I remember Wolfgang saying once that the hanging node constraint enforcement in deal.II was the hardest part to write and that it makes up a significant fraction of the overall lines of code of the library.
This was a few years ago so maybe that's changed.
If you really do need a conforming mesh, then p4est might not do what you need out of the box.
There probably are ways to turn a mesh with hanging nodes into a conforming one by local topological transformations, at least in 2D.
If you just need fields to be continuous and don't actually have hard requirements on the mesh topology, then you might be able to work together something along the lines of what deal.II does.
Judging by how much effort went into what deal.II does for hanging nodes, that might be a lot of work.