It’s absolutely possible to do something like that in Unreal.
To create the lines/patterns you would make the ball either spawn shapes as it moves or add points to a spline mesh.
For the racket, it might be easiest to go with a Vive-tracker attached to a racket (you don’t have to use the VR headset), as that gives you reliable tracking without having to make custom tools to get the movement of the racket.
Not sure if there is a template that you could use. But it would be fairly easy to get something like that up and running.
Let me know if you need som guidance.
And welcome to the wonderful world of game development