Wheel keeps going out of alignment and loosening the chain I have an electric bike with internal hub gears on the rear wheel, so no derailleur. This means that for the chain to stay tight, the wheel axle needs to be dragged back into its seating before it is fastened so there is enough tension. However, ever since I removed my rear wheel once to change its tube, the wheel axle won't stay aligned. The side with the chain keeps slipping a few millimeters out until the wheel is at an angle and one side almost touches the brakes and frame, and also makes the chain loose so that it frequently pops off the sprocket.

It's driving me crazy, I've tried like five times now to readjust the wheel and fasten it, yet after riding for a kilometer it slides back. It happens no matter how much I tighten the nut. 

I can see on the metal of the frame that the jagged washer of the nut has eaten into a bit and made marks, can this be the cause? What can I do about this?
The short answer is the axle nuts need to be done up tighter than you are doing them up it now. If you can't tighten them more, you need a longer wrench to be able to apply more torque.

There are tension adjustment devices that fit over the axles and in the dropouts that make tensioning the chain and aligning the wheel easier, and help prevent the wheel moving.

According to Park Tool, the nuts should be tightened to about 25Nm; see their video on single speed (or IHG) bikes for how to estimate that torque if you don't have a torque wrench.