Is it possible to use mathematical formulas and equations from real life physics and use it in my game through programming?
Yes! This is what every modern game engine does.
The problem, though, is that the formula is not contiguous. The ball, flying through the air, is affected by momentum, gravity, spin, and air resistance (which in turn might be affected by velocity and spin, depending on how detailed you want to make the model.)
But, as soon as the ball makes contact with the ground, or the net, or a racket, the physical interaction between the ball and those objects, needs to be considered. This causes a discontinuity in the simulation. You need to essentially stop the simulation of “ball flying on its own” and apply a simulation of “ball being hit by racket.” Until it leaves contact with the racket.
Further, for any object controlled by a player, every single frame of simulation may have a discontinuity, because the player could have added new input (moved the mouse / joystick, pressed a button, …)
So, what a physics engine does, is encode a bunch of physical equations (restitution, air drag, angular momentum, etc) togther with a bunch of geometric algebra equations (for whether a squished ball is in contact with a moving racket or not, etc,) and, for each simulation step, chooses which particular physical equations to apply, and simulates until the next interaction (or, more commonly, the next display frame.)
On a modern computer, simulating the air resistance from a rotating ball, and the deformation of the ball when it hits objects, and even the deformation of the tennis racket web of strings, is totally tractable, even on a lowish-end laptop. However, if you have, say, a hundred such balls, and a hundred such rackets, that lowish-end laptop wouldn't have enough CPU power to simulate all of that in real time. Hence, game physics that focus on “many objects” rather than “a few, very accurate objects,” end up taking shortcuts – balls don't deform, air drag is only dependent on velocity and a fixed constant, etc.