Example 4 In the right triangle $\triangle ABC$, $\angle C=90^{\circ}, AC=$ 3, a square $ABEF$ is constructed outward from side $AB$, with the center of the square being $O$, and $OC=4\sqrt{2}$. Then the length of $BC$ is $(\quad)$.
(A) $3\sqrt{2}$
(B) 5
(C) $2\sqrt{5}$
(D) $\frac{9}{2}$
Solve as shown in Figure 4, draw a perpendicular from point $E$ to the extension of line $CB$ and a perpendicular from point $F$ to the extension of line $CA$, intersecting at point $G$. It is easy to prove
$$
\begin{array}{l}
\cong \text { Rt } \triangle E F G \\
\cong \text { Rt } \triangle F A H \text {. } \\
\text { Therefore, } A C=B D=E G=F H=3 \text {, } \\
B C=D E=G F=H A \text {. } \\
\end{array}
$$

Thus, quadrilateral $C D G H$ is a square, and $O C$ is half the diagonal of the square.
Given $O C=4 \sqrt{2}$, the side length of square $C D E F$ is
$$
C D=C B+C D=\sqrt{2} O C=8 \text {. }
$$

Therefore, $B C=C D-B D=5$.