NEVER EVER. Wire gauges differ for a purpose, and the most important one is amperage. Sure, it'll work, but it's completely incorrect, and the #18 gauge wire becomes a fusible link and a fire hazard. Things would be easy to put it right by pulling the #12 wire with the #18 wire.