It is very well known that the dimension of $SO(n)$ is $n(n-1)/2$, which is obtained by the number of independent constraint equations we have from the fact that the matrix is orthogonal.
However, it is a little puzzling to me why the determinant constraint does not affect the dimension, because the determinant constraint seems to be another independent constraint equation to the matrices.
You can vary $n(n-1)/2$ parameters continuously and keep the determinant equal to $1$, or equal to $-1$, but to get from one to the other you have to make a discontinuous jump.
The split of $O(n)$ into $SO(n)$ and its complement is a little bit like how the equation $x^2=1$ in the $(x,y)$-plane defines two lines $x=1$ and $x=-1$, both one-dimensional. (In this analogy, $x^2=1$ corresponds to $O(n)$, and the extra condition $x>0$ corresponds to choosing the positive sign for the determinant, so that the line $x=1$ corresponds to $SO(n)$. But this choice of sign doesn't reduce the dimension.)