Hamiltonian is not necessarily giving energy. In general, a time-independent Hamiltonian has to be conserved, while energy need not be. The simplest example is perhaps the harmonic oscillator; for that, see e.g. my answers here:
When is the Hamiltonian of a system not equal to its total energy?
Intuitive explanation for why time symmetry implies conservation of energy?
So yes, some systems that do not conserve energy can be described by Lagrangians/Hamiltonians. However, cellular automaton is a discrete step system; Lagrangians and Hamiltonians were meant and apply well for continuously evolving systems.
I don't know if there is a re-interpretation of Lagrangian/Hamiltonian description for discrete state systems. Maybe if the update rule of the automaton is augmented/completed into a continuous evolution in time. But then there would be new states "in between" two classical states of the automaton, so it would something very different.
Discrete computation is conceptually very different from evolution of a Lagrangian/Hamiltonian physical system, similar to how the set of integer numbers is very different from the set of real numbers. Discrete state system has a finite number of details; but continuous system has infinitely fine detail and there is no limit to how small a change can be made.