Can I safely pigtail #10 wire and #12 wire on a 20 amp circuit?
If copper, no problem, easy, yes you can use 12Ga copper to add to it, it was just overbuilt. Using larger wire than required is fine, code only specifies the minimum size required.

Do make sure you use wire nuts (or other wiring connectors) rated for the combination and number of wires you use. There is normally a little table on the container listing acceptable combinations of wires for this particular size connector.

If Aluminum, it's complicated and not burning your house down is a main consideration.