(Disclaimer : I know very well that $SO(N)$ has a Lie algebra of dimension $N(N-1)/2$ etc. This absolutely not the point of my question.)

To make my problem more understandable, I start with the example of $SO(2)$. All $SO(2)$ matrices $M$ can be written as ($\theta\in [0,2\pi[$) $$ M=\begin{pmatrix}\cos\theta & \sin\theta\\ -\sin\theta&\cos\theta\end{pmatrix}. $$ Using the basis of $2\times2$ real matrices $\sigma_0=\begin{pmatrix}1 & 0\\0&1\end{pmatrix}$, $\sigma_1=\begin{pmatrix}0 & 1\\1&0\end{pmatrix}$, $\sigma_2=\begin{pmatrix}0 & 1\\-1&0\end{pmatrix}$, $\sigma_3=\begin{pmatrix}1 & 0\\0&-1\end{pmatrix}$, one find that

$$M=\cos\theta\;\sigma_0+\sin\theta\;\sigma_2.$$ Clearly, $M$ does not have components along $\sigma_1$ and $\sigma_3$, so the dimension of the smallest linear subspace of $\mathrm{M}_2(\mathbb{R})$ that contains $SO(2)$ is $2$.

How to articulate the reasoning (for the cases $N>2$ in particular) is not completely clear. I guess that we can say that the component along $\sigma_0$ and $\sigma_2$ are independent because $\cos\theta$ and $\sin\theta$ are independent functions (in a functional analysis sense).

Assuming that made sense, we can try to increase $N$. For example, an $SO(3)$ matrix can be written as $$ M=\left(\begin{matrix} \cos\varphi\cos\psi - \cos\theta\sin\varphi\sin\psi & -\cos\varphi\sin\psi - \cos\theta\sin\varphi\cos\psi & \sin\varphi\sin\theta\\ \sin\varphi\cos\psi + \cos\theta\cos\varphi\sin\psi & -\sin\varphi\sin\psi + \cos\theta\cos\varphi\cos\psi & -\cos\varphi\sin\theta\\ \sin\psi\sin\theta & \cos\psi\sin\theta & \cos\theta \end{matrix}\right)\, $$ with $(\phi,\psi)\in [0,2\pi[^2$ and $\theta\in [0,\pi[$. Now, if I look at each matrix element one by one, they are all independent in a functional sense.$^*$ Does that mean that the ''dimension of the matrix space'' that $SO(3)$ matrices live in is $9$ ? Is there a way to generalize that to arbitrary $N$ ?

In the end, does any of what I wrote above make any sense ?

$^*$ It is slightly more subtle than that for the $\theta$ dependence, because in the end I am interested in doing integral over the Haar measure, which means that one should look at $x=\cos(\theta)\in[-1,1]$. But $x$ and $\sqrt{1-x^2}$ are orthogonal, so all should be fine.

specialorthogonal matrices. I think that this is what confused Denis. $\endgroup$