How tight should I screw my thru-axles? I have a new road bike with thru axle and disc brakes (Ultegra). I noticed that depending on the how tight I screw the axle in the frame, the brake disc will be closer to either side of the brake pads. I didn't pay attention at first, so now the rear left pad is much more worn that the right one.

Is there a way to find the perfect torque to make sure that the disc is perfectly centered?
You should screw your through axle according to the manufacturer's specified torque value range. The torque applied to the axle is not meant to be used for adjusting relative brake/disc position, even if you observe such effect. Keeping the axle under-torqued is dangerous, and over-torquing it might damage the fork/frame dropouts.

A proper solution would be to adjust the position of the brake caliper itself relative to the disc. One possible way to achieve that:


Screw the wheel's axle to manufacturer's recommended torque.
Loosen both bolts that attach the caliper to the fork/frame. Do not unscrew them too much; you should just be able to wobble the caliper by hand.
Squeeze the brake lever so that both pads hug the disc. If the pads were symmetric, then the caliper would become centered relative to the disc. In your case, you should probably do this with a new pair of pads.
Keeping the lever pressed (by using a rubber band, rope etc.), tighten the caliper bolts so that the caliper will stay in the new position. Make sure to tighten these bolts to a proper torque as well (typically in a range 7-9 N×m, but it may be different)


Now, when you release the brake lever, the distance between pads and disc surfaces will be equal (given that both pads move at the same rate, of course).