can a 240 dryer outlet be moved using a junction box?
The answer is yes if the conductors meet code.you already turned off,  Remove The receptacle install a clamp in the old box for the new wire to feed the new the receptacle If Romex the putter insulation 1/4” inside the clamp and 6” wire minimum. Use appropriate sized wire-nuts and install a blank cover, put the new box where you want it , bring the wire in make sure to have at least 6” and the putter covering or insulation inside the box by 1/4” reconnect your receptacle and you are ready to plug in. 
Electric driers are usually #10 wire on a 30 amp breaker. Can be larger but that is normal.
I usually use 4 square metal boxes with a 30 amp 1/2” raised cover .  The receptacle should be a 4 wire by today’s code well and the last few cycles.
Good luck.