Can I wire light sockets with 12 gauge wire
As an electrician I always like to see fixtures with a UL Listing, but the wire size on your socket is used since it assumes a certain maximum wattage (amperage) lamp and therefore is allowed by the manufacturer. You can connect it up to a #12 wire on a 20A circuit since that is greater than the intended load of the lamp.

If you're interested that's covered in Article 402 in the NEC.