To solve for \( x \) in triangle \( ABC \) with \( AB = BC = 12 \) and \( BH \) being the altitude, we can start by determining the lengths of its other sides using the properties of the isosceles triangle.
Since \( AB = BC \), we can drop a perpendicular from point \( B \) to side \( AC \) at point \( H \), which also bisects \( AC \) because the triangle is isosceles.
Let's denote the following:
- \( AH = CH = x \) (the segments on side \( AC \))
- \( AC = AH + CH = x + x = 2x \)
In right triangle \( ABH \), we can apply the Pythagorean theorem:
\[ AB^2 = AH^2 + BH^2 \]
Substituting the known values, we have:
\[ 12^2 = x^2 + x^2 \]
This simplifies to:
\[ 144 = 2x^2 \]
Dividing both sides by 2 gives:
\[ 72 = x^2 \]
Taking the square root of both sides results in:
\[ x = \sqrt{72} = 6\sqrt{2} \]
So, the correct answer is:
D. \( x = 6\sqrt{2} \)