Is it a hazard to use spray foam around baseboard heater pipe?
Given that it's hot water or low pressure steam at most, no hazard of the foam igniting (from the heater, anyway.)

Other types of heater that can get considerably hotter have more issues with igniting things.