Chain rule use in discontinuous generalized function derivative

Let's assume we have a function of the following form $$f(x,a):=g(H(a-x))$$, where $$H$$ is the Heaviside step function. We now would like to look at the derivative $$\frac{\partial}{\partial x}\int_0^1 f(x,a)da$$. (This form should explain the "generalized functions" in the title.)

The actual question now is if it is allowed to write the following: $$\frac{\partial}{\partial x}\int_0^1 f(x,a)da = \int_0^1 \frac{\partial g(y)}{\partial y} \cdot \frac{\partial H(a-x)}{\partial x} da,$$ where $$y = H(a-x)$$.

In a general setting the chain rule can to my understanding not be used under such circumstances, since $$H(x-x)=\infty$$ and thus the differentiability of $$g$$ at this point is a little hard to define. Additionally $$H(a-a$$ neither is differentiable at this point. Also when doing this we have the weird situation of the multiplication of a step function with a Dirac delta, both having discontinuities at $$x=a$$.

Does someone know about the rules in such points? Does there exist a chain rule for Heaviside step functions?

Not quite. For simplicity assume $$g$$ is $$C^1$$
$$g(H) = g(0)+ (g(1)-g(0))H$$ whose distributional derivative is $$(g(1)-g(0))\delta$$.
Taking $$\phi \in C^\infty_c,\int \phi=1,\phi_n(x)=n\phi(nx)$$ then $$H\ast \phi_n \to H$$.
$$g(H\ast \phi_n)\to g(H)$$ in the sense of distributions, and we'll have no fear to say that
$$(g(H\ast \phi_n))'=g'(H\ast \phi_n) (H\ast \phi_n)'=g'(H\ast \phi_n) \phi_n \to (g(H))'$$ in the sense of distributions.
So $$\lim_{n\to \infty}g'(H\ast \phi_n) (H\ast \phi_n)'$$ is the true distributional meaning of $$g'(H) H'$$. It is merely saying that the correct value of $$g'(H(0))$$, which gives $$(g(H))'= g'(H(0)) \delta$$ is $$g'(H(0))=\int_0^1 g'(x)dx$$.