Can I hook up two baseboard heaters on a 30 amp double pole breaker with #12 wire?
No!  12/2 wire is NOT suitable for a 30 A circuit.

While there are other considerations, you will need to use a MINIMUM of 10 AWG Cu wire for a 30A circuit.

Beyond that, whether 30A is enough for your two heaters cannot be answered because that depends on the current requirements for the heaters.