Wiki page of Dynkin's formla says:
Let $X$ be the $R^n$-valued Itō diffusion solving the stochastic differential equation
$$\mathrm {d} X_{t}=b(X_{t})\,\mathrm {d} t+\sigma (X_{t})\,\mathrm{d} B_{t}.$$
Let $A$ be the infinitesimal generator of $X$, defined by its action on compactly-supported $C^2$ (twice differentiable with continuous second derivative) functions $f : Rn → R$ as $$Af(x)=\lim_{t\downarrow 0}{\frac {\mathbf {E} ^{x}[f(X_{t})]-f(x)}{t}}$$
Then Dynkin's formula holds: $$ \mathbf {E} ^{x}[f(X_{\tau})]=f(x)+\mathbf {E} ^{x}\left[\int _{0}^{\tau }Af(X_{s})\,\mathrm {d}s\right].$$
I'm confused here : does Dynkin's formula only applies to $\mathrm {d} X_{t}=b(X_{t})\,\mathrm {d} t+\sigma (X_{t})\,\mathrm{d} B_{t}$, or it also works for
$$\mathrm {d} X_{t}=b(t, X_{t})\,\mathrm {d} t+\sigma (t, X_{t})\,\mathrm{d} B_{t}$$
?
On user1's answer that infinitesimal generator are defined only on time-homogeneous Ito diffusions, I don't agree.
Below is from Stochastic Processes in Polymeric Fluids by HC Öttinger.
First on p74 a general infinitesimal generator is defined:

Then on p76 it specifically refers to Wiener process as time homogeneous example:

Also, infinitesimal generator is widely used to prove Kolmogorov equations, which are not limited to time homogeneous processes.
Just add the index ${}_t$ in all the right places and you'll see the proof goes through.
Alternatively, apply the homogenous result to the homogeneous space time process associated to your inhomogeneous process.