I've studied physics too, and I would say that it is possible, in theory, for shinra tensei to canel out Kamui because of its gravitational properties and its ability to affect time and space. However, I think it have to be a very powerful gravitational force and not just the temporary "burst" that pain/nagato has shown because gravity's ability to bend space/time is limited on the amount of mass an object has, or in this case the chakra used to create the wave of gravitational force through the rinnegan.
Kamui actually creates a hole in the space/time continuum that bridges the NV with Obito's dimension, so, in theory, in order to completely cancel it out, Pain/Nagato would have to conjour gravitational energy equivalent or possibly even greater than that of a black hole as it is unknown whether black holes are simply extremely long wells in the fabric of space/time created by the overlydense amount of matter in the singularity that lead to an infinitely small point of oblivion, or whether they create an actual gap between two universes due to its gravitational forces, which would make them wormholes of sorts.
Since the Kamui is also a wormhole/eventhorizon of sorts with a set focus point, that is set by Kakashi, the origin of that point is where Pain/Nagato would have to actually create the focus of Shinra Tensei, otherwise it would simply create a ripple across the actual tear, but not enough to close it completely.