Wiring question regarding switching wire gauge within a circuit
Go for it

Since it's a 20A circuit, you can use any wire size 12AWG or larger to run it.  (The existing 10AWG may have simply been what the original installer had on hand, or may have been installed for voltage drop control reasons.)