If the law of Karma is a natural law like Newton's law? Can we write an equation for it? at least in principle because I know that there are lots of variables involved. but if it really is a part of nature then why not?
Newton's laws are simple, they model of a simplified universe. They describes the relationship between "force" and the motion of a single object in an otherwise-empty universe.

If you consider two objects in the universe then there are a bunch of other laws: the law of gravity, laws of electrostatics, etc.

If you consider three objects in the universe then it cannot be generally solved by an equation:


  In 1887, mathematicians Ernst Bruns [4] and Henri Poincaré showed that there is no general analytical solution for the three-body problem given by algebraic expressions and integrals. The motion of three bodies is generally non-repeating, except in special cases.[5]


... and that's just classical mechanics, ignoring relativistic and quantum mechanics.

Something like the weather (how strong the wind is going to be, whether it will rain, what the temperature will be) is arguably "part of nature". There too there are "lots of variables" involved. In order to predict tomorrow's weather, "an equation" isn't enough: they need to use many, many equations, and a supercomputer on which to run simulations, and even then it's only limited accuracy and range.

Similarly I think it's possible to say that Karma exists and is a "natural law", just as it's possible to say that weather exists.

Perhaps you'd think it might be easy, but in practice it isn't easy, to describe weather even using several equations, let alone just "an equation". You needs laws describing temperature, pressure, density, fluid dynamics, Coriolis because the earth is spinning, differential heating, and then local weather caused by the existence of land and sea and mountains and ocean currents etc. etc. etc.

Again I suggest you stop trying to see a link between Buddhism and Physics. Physics is useful as far as it goes, but it cannot even describe the relationship between a boy and his dog (or perhaps "between a child and a teacher" if you don't have any relationships with dogs).