In installing a dishwasher on a dedicated 20amp circuit on 12g wiring, I've come short about 5 feet to run a line. I have some surplus, heavier, 10g wire. Would it be safe to install a junction box and hook 10g wire to the existing 12g wire to bring enough wire to the dishwasher?
I don't like it since it risks potential confusion in the future as to whether the circuit could be upgraded to 30amps, but if you're going to do it, use the 10g wire at the end of the run and not at the breaker panel where the mistake would be easier to make.
Yes, you can use larger wire. However if you are putting in a junction box it must remain accessible. That means you cannot cover it with drywall or hide it behind anything.