Even for the simplest equation of this sort, $y'=y(ax)$, there is no simple formula.
Substitute a power series at $0$, and you obtain a series which is divergent when $|a|>1$.
This shows that there is no solution analytic at $0$.
(If $|a|\leq 1$ this series is convergent everywhere, but still no formula is known
simpler than the series itself.)
On the other hand, you can reduce to a differential-difference equation, as Anthony Quas recommends, and if $f$ and $g$
are constants, this differential-difference (DD) equation can be solved with
Fourier or Laplace transform, depending on your assumptions
about $y$. Of course the DD equation always has infinitely many simple
discontinuous solutions,
depending on an arbitrary function, but probably this is not what you are looking for.