Can I connect a 5 V CAN transceiver to a 3.3 V microcontroller?
It should indeed work

The Vih on the TXD pin of the CAN transceiver you're using is 2.0V, while the Voh for the STM32 is 2.4V; considering that the STM32 family has 5V tolerant input pins for most of its digital-only I/Os (including the ones you're using assuming we're talking about the LQFP176 package here), you're good on both sides of the deal here.