As noticed by Reinhard, a necessary and sufficient condition is $m\geq n$. Below you can read a simple existencial proof of this fact.
Consider $B_{m\times m}=\begin{pmatrix}(1-\frac{n}{m})Id_{n\times n} & 0_{n\times (m-n)}\\
0_{(m-n)\times n} & -\frac{n}{m}Id_{(m-n)\times (m-n)}\end{pmatrix}$.
Notice that $B$ is a traceless real symmetric matrix. Hence there is an orthogonal matrix $U_{m\times m}$ such that $UBU^t=C$ and $C_{ii}=0$ for $i=1,\ldots,m$.
Define $D=\frac{n}{m}Id_{m\times m}+C$.
Notice that $Spec(D)= \stackrel{n}{\overbrace{1,\ldots,1}},\stackrel{m-n}{\overbrace{0,\ldots,0}}$ and $D_{ii}=\frac{n}{m}$ for $i=1,\ldots,m$.
Since $D_{m\times m}$ is a positive semidefinite symmetric matrix of rank $n$, there exists $R_{m\times n}$ such that $D=RR^t$.
Next, $R^tR=Id_{n\times n}$, since $Spec(R^tR)=\stackrel{n}{\overbrace{1,\ldots,1}}$ and $R^tR$ is a real symmetric matrix of order $n$.
Let $R^t=(v_1,\ldots,v_m)$, where $v_i$ is column $i$ of $R^t$.
Then $Id_{n\times n}=R^tR=\sum_{i=1}^mv_iv_i^t$.
Finally, $v_i^tv_i=D_{ii}=\frac{n}{m}$, for $i=1,\ldots,m$. $\square$
Edit: Let us prove that every traceless real symmetric matrix $S_{m\times m}$ is orthogonally equivalent to a symmetric matrix with zeros in the diagonal.
Let $v_1,\ldots,v_m$ be an orthonormal basis of eigenvectors of $S$. Define $v=\frac{v_1+\ldots+v_m}{\sqrt{m}}$.
Notice that $v^tSv=\frac{tr(S)}{m}=0$. Let $U_{m\times m}$ be any orthogonal matrix such that the first column of $U$ is $v$. So $U^tSU_{11}=0$.
Now, since $U^tSU_{11}=0$ and $U^tSU$ is traceless, the submatrix $A_{m-1\times m-1}$ occupying the last $m-1$ rows and columns of $U^tSU$ is also a traceless real symmetric matrix.
By induction on $m$, there is an orthogonal matrix $V_{m-1\times m-1}$ such that $V^tAV$ is symmetric with zeros in the diagonal.
So $W=\begin{pmatrix}1 & 0_{1\times m-1}\\
0_{m-1\times 1} & V_{m-1\times m-1}\end{pmatrix}$ is orthogonal and $W^tU^tSUW$ is symmetric with zeros in the diagonal.
Finally, $UW$ is orthogonal too.