Extension of formula for solution of heat equation on distributions Consider a heat equation
$$
   u_{t} = u_{xx}+f(t,x),\; (x,t) \in (0,L)\times(0,T] \\
   u(0,x) = 0, \; x \in [0,L] \\
   u(t,0) = 0, \; t \in [0,T] \\
   u(t,L) = 0, \; t \in [0,T].
$$
If $f(t,x)$ is a regular function then solution of this system is given by [Tikhonov, Equations of Mathematical Physics]:
$$
   u(t,x) = \int\limits_{0}^{t} \int\limits_{0}^{L} G(x,\xi,t-\tau)f(\xi,\tau)d\xi d\tau,
$$
where
$$
   G(x,\xi,t) = \frac{2}{l}\sum\limits_{n=1}^{\infty} \sin \left( \frac{\pi n}{L}x \right) \sin \left( \frac{\pi n}{L} \xi \right) \exp \left( -\left( \frac{\pi n }{L} \right)^2 t \right)
$$
Tikhonov writes that this formula for solution may be extended to larger class of functions $f$. My question is how large is this class? Which class of distributions we can put in formula for solution? Is it possible for such distributions as $f(t,x)=h(t)\delta(x-x_0)$, where $h$ is a regular function?
The Green's formula given in Tikhonov's book is valid until Green's formula
$$
\int_0^L G f dx
$$
makes sense.

In your case, $G$ is continuous in $x \in [0, L]$, therefore $u(t, x)$ is defined also for $f(x, t) = h(t) \delta(x - x_0)$.
Note that your solution can be obtained by this approach:

Let $u(t,x)=\sum\limits_{n=1}^\infty C(t,n)\sin\dfrac{\pi nx}{L}$ so that it automatically satisfies $u(t,0)=0$ and $u(t,L)=0$ ,

Then $\sum\limits_{n=1}^\infty C_t(t,n)\sin\dfrac{\pi nx}{L}=-\sum\limits_{n=1}^\infty\dfrac{\pi^2n^2}{L^2}C(t,n)\sin\dfrac{\pi nx}{L}+f(t,x)$

$\sum\limits_{n=1}^\infty C_t(t,n)\sin\dfrac{\pi nx}{L}+\sum\limits_{n=1}^\infty\dfrac{\pi^2n^2}{L^2}C(t,n)\sin\dfrac{\pi nx}{L}=f(t,x)$

$\sum\limits_{n=1}^\infty\biggl(C_t(t,n)+\dfrac{\pi^2n^2}{L^2}C(t,n)\biggr)\sin\dfrac{\pi nx}{L}=f(t,x)$

For $0&lt;x&lt;L$ ,

$\sum\limits_{n=1}^\infty\biggl(C_t(t,n)+\dfrac{\pi^2n^2}{L^2}C(t,n)\biggr)\sin\dfrac{\pi nx}{L}=\sum\limits_{n=1}^\infty\dfrac{2}{L}\int_0^L f(t,x)\sin\dfrac{\pi nx}{L}dx~\sin\dfrac{\pi nx}{L}$

$\therefore C_t(t,n)+\dfrac{\pi^2n^2}{L^2}C(t,n)=\dfrac{2}{L}\int_0^L f(t,x)\sin\dfrac{\pi nx}{L}dx$

$\dfrac{\partial}{\partial t}\left(e^{\frac{\pi^2n^2t}{L^2}}C(t,n)\right)=\dfrac{2e^{\frac{\pi^2n^2t}{L^2}}}{L}\int_0^L f(t,x)\sin\dfrac{\pi nx}{L}dx$

$e^{\frac{\pi^2n^2t}{L^2}}C(t,n)=\dfrac{2}{L}\int e^{\frac{\pi^2n^2t}{L^2}}\int_0^L f(t,x)\sin\dfrac{\pi nx}{L}dx~dt$

$e^{\frac{\pi^2n^2t}{L^2}}C(t,n)=A(n)+\dfrac{2}{L}\int_0^t e^{\frac{\pi^2n^2t}{L^2}}\int_0^L f(t,x)\sin\dfrac{\pi nx}{L}dx~dt$

$C(t,n)=A(n)e^{-\frac{\pi^2n^2t}{L^2}}+\dfrac{2e^{-\frac{\pi^2n^2t}{L^2}}}{L}\int_0^t e^{\frac{\pi^2n^2t}{L^2}}\int_0^L f(t,x)\sin\dfrac{\pi nx}{L}dx~dt$

$\therefore u(t,x)=\sum\limits_{n=1}^\infty\biggl(A(n)e^{-\frac{\pi^2n^2t}{L^2}}+\dfrac{2e^{-\frac{\pi^2n^2t}{L^2}}}{L}\int_0^t e^{\frac{\pi^2n^2t}{L^2}}\int_0^L f(t,x)\sin\dfrac{\pi nx}{L}dx~dt\biggr)\sin\dfrac{\pi nx}{L}$

$u(0,x)=0$ :

$\sum\limits_{n=1}^\infty A(n)\sin\dfrac{\pi nx}{L}=0$

$A(n)=0$

$\therefore u(t,x)=\dfrac{2}{L}\sum\limits_{n=1}^\infty\int_0^t e^{\frac{\pi^2n^2t}{L^2}}\int_0^L f(t,x)\sin\dfrac{\pi nx}{L}dx~dt~e^{-\frac{\pi^2n^2t}{L^2}}\sin\dfrac{\pi nx}{L}$

In fact your formula only differ from representation:

$\dfrac{2}{L}\sum\limits_{n=1}^\infty\int_0^t e^{\frac{\pi^2n^2t}{L^2}}\int_0^L f(t,x)\sin\dfrac{\pi nx}{L}dx~dt~e^{-\frac{\pi^2n^2t}{L^2}}\sin\dfrac{\pi nx}{L}$

$=\dfrac{2}{L}\sum\limits_{n=1}^\infty\int_0^t e^{\frac{\pi^2n^2\tau}{L^2}}\int_0^L f(\tau,\xi)\sin\dfrac{\pi n\xi}{L}d\xi~d\tau~e^{-\frac{\pi^2n^2t}{L^2}}\sin\dfrac{\pi nx}{L}$

$=\int_0^t\int_0^L\sum\limits_{n=1}^\infty\dfrac{2}{L}e^{-\frac{\pi^2n^2(t-\tau)}{L^2}}\sin\dfrac{\pi nx}{L}\sin\dfrac{\pi n\xi}{L}f(\tau,\xi)~d\xi~d\tau$

Hence this result works when $f(t,x)$ can be expressed by fourier sine series with respect to $x$ .