The axle can "walk" in the dropouts as you tighten the nuts, especially if it's a frame with semi-horizontal dropouts. I pull the right (drive) side into the dropout first, tighten the nut moderately firmly, then centre the wheel & tighten the left-side nut about the same amount. Loosen the right side nut a little, double check the axle is seated in the dropout properly, then properly tighten the nut. Loosen the left nut, check centring, then properly tighten that nut.
If the frame has vertical dropouts, this isn't as touchy. Stand the bike up the right way on the ground (you may wish to employ a helper to hold the bike for you), loosen the nuts & allow the weight of the bike to rest squarely on the axle, then tighten the nuts.
Just ride the bloody thing and enjoy yourself!