Step 1: Formation of \(X\).
Anisole undergoes Friedel--Crafts alkylation with methyl chloride in the presence of anhydrous \(\mathrm{AlCl_3}\).
The methoxy group is an ortho/para-directing group, and the para product predominates due to less steric hindrance.
Hence,
\[
X=\textit{p}\text{-Methylanisole}
\]
Step 2: Formation of \(Y\).
Bromobenzene on fusion with NaOH followed by acidification gives phenol.
Thus,
\[
Y=\mathrm{C_6H_5OH}
\]
(Phenol).
Step 3: Final conclusion.
Therefore,
\[
\boxed{X=\textit{p}\text{-Methylanisole},\qquad
Y=\text{Phenol}}
\]
Hence, the correct option is \(\boxed{(D)}\).