Can you connect a 14 gauge electrical wire with a 12 gauge?
You can do this, but you must make sure the breaker for the circuit is a 15A breaker, not a 20A breaker. It is also possible that someone in the future may look at the 12 gauge wire coming out of a 15A breaker and think "I can up that to 20A by just replacing the breaker", so labeling it properly on the panel is important.