We are given the determinant of a 3x3 matrix and asked to find the value of \( \theta \). First, compute the determinant of the matrix:
\[
\begin{vmatrix}
0 & -\sin^2 \theta & -2 - 4 \cos 6\theta \\
0 & \cos^2 \theta & -2 - 4 \cos 6\theta \\
1 & \sin \theta & \cos 2\theta
\end{vmatrix}.
\]
We use cofactor expansion along the first row. The determinant simplifies to:
\[
0 \cdot \begin{vmatrix} \cos^2 \theta & -2 - 4 \cos 6\theta \\ \sin \theta & \cos 2\theta \end{vmatrix}
- (-\sin^2 \theta) \cdot \begin{vmatrix} 0 & -2 - 4 \cos 6\theta \\ 1 & \cos 2\theta \end{vmatrix}
+ (-2 - 4 \cos 6\theta) \cdot \begin{vmatrix} 0 & \cos^2 \theta \\ 1 & \sin \theta \end{vmatrix}.
\]
The first term is zero. Now, simplify the second and third terms:
\[
= \sin^2 \theta \cdot \begin{vmatrix} 0 & -2 - 4 \cos 6\theta \\ 1 & \cos 2\theta \end{vmatrix}
- (2 + 4 \cos 6\theta) \cdot \begin{vmatrix} 0 & \cos^2 \theta \\ 1 & \sin \theta \end{vmatrix}.
\]
\[
\begin{vmatrix} 0 & -2 - 4 \cos 6\theta \\ 1 & \cos 2\theta \end{vmatrix} = (0)(\cos 2\theta) - (1)(-2 - 4 \cos 6\theta) = 2 + 4 \cos 6\theta,
\]
\[
\begin{vmatrix} 0 & \cos^2 \theta \\ 1 & \sin \theta \end{vmatrix} = (0)(\sin \theta) - (1)(\cos^2 \theta) = -\cos^2 \theta.
\]
Thus, the determinant simplifies to:
\[
\sin^2 \theta (2 + 4 \cos 6\theta) - (2 + 4 \cos 6\theta) (-\cos^2 \theta).
\]
Factor out \( (2 + 4 \cos 6\theta) \):
\[
(2 + 4 \cos 6\theta)(\sin^2 \theta + \cos^2 \theta) = 0.
\]
Since \( \sin^2 \theta + \cos^2 \theta = 1 \), the equation becomes:
\[
2 + 4 \cos 6\theta = 0.
\]
Step 2: Solve for \( \cos 6\theta \):
\[
4 \cos 6\theta = -2 \quad \Rightarrow \quad \cos 6\theta = -\frac{1}{2}.
\]
Step 3: Solve for \( 6\theta \):
\[
\cos 6\theta = -\frac{1}{2} \quad \Rightarrow \quad 6\theta = \frac{2\pi}{3}, \quad \text{or} \quad 6\theta = \frac{4\pi}{3}.
\]
Step 4: Divide by 6:
\[
\theta = \frac{\pi}{9}, \quad \text{or} \quad \theta = \frac{2\pi}{9}.
\]
Since \( \theta \in \left( 0, \frac{\pi}{3} \right) \), the valid solution is \( \theta = \frac{\pi}{9} \).
Thus, the correct answer is option (D).