Commute a 12 V siren with an ESP01
You need the transistor to be a saturated switch.
The datasheet for your transistor and nearly every other transistor shows that its base current should be 1/10th its collector current for it to saturate well. Then the base current must be 300mA/10= 30mA. Can the ESP01 output 30mA at a reasonable voltage?

The saturation voltage loss is shown as a max of 0.5V at 500mA so might be 0.4V at 300mA. Then the transistor heats with 0.4V x 300mA= 0.12W and it will be warm but not hot.