I don't get it ?
Sink drains are made to be positioned in 3 axis.
You match the height of the drain stub by adjusting the ABS drain to the tail piece vertically and tightening the collar.
You match the output of the P-Trap to the drain stub by rotating the 2 P-Trap sections & it's short horizontal run CW or CCW as needed to get it to line up with the drain stub.
I've never had a problem getting hard parts to line up perfectly ?
If the stub is further away than what the adjustability of the P-Trap sections allow, i would just put a 45* in the horizontal exit of the P-Trap ?
Not my work below, but you get the idea.
The white horizontal piece could have been sectioned shorter for a cleaner install in this pic (or just go to hardware store and buy a shorter one (looks like it has threads on the end).