Is there a nice condition on a closed subscheme $Y$ of $X$ such that for every flat family $Z\to Y$, there is a flat family $W\to X$ whose restriction to $Y$ is $Z$? In particular, I'm interested in the case when the closed subscheme is two lines in $\mathbb{P}^2$, or three planes in $\mathbb{P}^3$, or generally $n$ hyperplanes in $\mathbb{P}^n$.
I'm pretty sure the answer is not in general.
Take a Hilbert scheme which is reducible, for example, that of the Hilbert polynomial $3t + 1$ in $\mathbb{P}^3$. This Hilbert scheme has two irreducible components  the one corresponding to twisted cubics and the one corresponding to degree 3 plane curves union a point. The intersection of the these two components corresponds to degree 3 nodal plane curves with an embedded point "pointing out of the plane". It turns out that both components are rational (actually this is pretty easy to see) and even that the intersection is rational. EDIT: I realized that, in this example, the family extended to $\mathbb{P}^2$ doesn't have to be as a family of closed subschemes in $\mathbb{P}^3$. Still, it cannot extend to a flat family in this example  just for a different reason. The general fiber of the extension would be a rational curve, but over a line in $\mathbb{P}^2$ you would have a disconnected family. This is impossible. 


This is not going to help too much in your case, but we do have the following I think. Suppose that we have a map $f : X \to Y$ which has a section (whose image we call $Y$ as well, as above), in other words $Y \subseteq X \to Y$ is an isomorphism. Given a flat family $Z \to Y$, we can form $Z \times_Y X \to X$. I think this should do what you want. Of course, it won't help with $Y = $ two lines in $\mathbb{P}^2$. 

