Answer: $A$
$\begin{bmatrix} \cos (\theta)&- \sin (\theta) \\ \sin (\theta)&\cos (\theta) \end{bmatrix}*\begin{bmatrix} a& 0 \\ 0&b \end{bmatrix}=\begin{bmatrix} a\cos (\theta)&{-b}\sin (\theta) \\a \sin (\theta)&b \cos (\theta) \end{bmatrix}$
and
$\begin{bmatrix} a& 0 \\ 0&b \end{bmatrix}*\begin{bmatrix} \cos (\theta)&- \sin (\theta) \\ \sin (\theta)&\cos (\theta) \end{bmatrix}=\begin{bmatrix} a\cos (\theta)&{-a}\sin (\theta) \\b \sin (\theta)&b \cos (\theta) \end{bmatrix}$
The multiplication will commute if
$a \sin (\theta) = b \sin (\theta)$ or a = b or $\theta = {n\pi}.$