In 2d, a rotation matrix has the form
$$
r(\theta)=\left(\begin{array}{cc}
\cos\theta&-\sin\theta\\
\sin\theta&\cos\theta\end{array}\right):=
\left(\begin{array}{cc}
c(\theta)&-s(\theta)\\
s(\theta)&c(\theta)\end{array}\right)
$$
and rotates vector in a plane.
In 3d a rotation matrix can be written as a product
$$
r_{12}(\psi)r_{13}(\theta)r_{12}(\varphi)
$$
where
\begin{align}
r_{12}(\psi)&=\left(\begin{array}{ccc}
c(\psi)&-s(\psi)&0\\
s(\psi)&c(\psi)&0\\
0&0&1
\end{array}\right)\\
r_{13}(\theta)&=\left(\begin{array}{ccc}
c(\psi)&0&-s(\psi)\\
0&1&0\\
s(\psi)&0&c(\psi)
\end{array}\right)
\end{align}
leaving one axis invariant. This axis can be identified by the row or column containing $0$s everywhere except for one entry.
In SO(4), one can write a rotation matrix as a sequence or $r_{ij}$ matrices. $r_{12}$ would have the form
$$
r_{12}(\psi)=\left(\begin{array}{cccc}
c(\psi)&-s(\psi)&0&0\\
s(\psi)&c(\psi)&0&0\\
0&0&1&0\\
0&0&0&1
\end{array}\right)
$$
and so leaves a 2-dimensional subspace invariant.
An SO(4) matrix can be written in the factored form
$$
r_{34}(\beta_1)r_{23}(\beta_2)r_{12}(\beta_3)
r_{34}(\beta_4)r_{23}(\beta_5)r_{34}(\beta_6)
$$
by restricting to real values the entries of the $SU(4)$ matrix factored as as done here. This is not by any means the only possible factorization.
Obviously, an SO(5) rotation can be written in terms of matrices leaving a 3-dimensional subspace invariant etc.