I live in an apartment on 2nd floor. The landlord lives downstairs and 3 people down there constantly smoke. It's so bad in my second bedroom. I bought expanding foam but afraid to spray around pipe where hole is because of heat. Is this a fire hazard or should I use silicone instead? And should I go along the bottom as well where the floor meets the wall or will that affect the heat? Also be Dangerous??
There are a few different issues here, including one that I'll bet you didn't think of:
This is your initial concern. Something like Great Stuff Foam will do well for this.
Here is where it gets...tricky. I have found various references - the one specific one I found for Great Stuff or similar foam (and it may vary both between brands and between products within a brand) was 240 F. That is high for a normal room. But is not so high if you are talking about a heating system. Around ordinary forced air ductwork that would be fine or around dryer ductwork (I found plenty of references to that). A big question though is What is your heating system?
It is gas heat...coils under baseboard
Gas heat is typically either forced air or a boiler heating water that is pumped through radiators. So "coils under baseboard" sounds like hot water. Which unless it is actually high pressure steam (not something typically found in apartments but used in some big buildings and industry), it is likely < 212 F and probably OK. But you might want to measure the temperature of these coils when the heat is on to get an idea of what you are really dealing with.
This is the biggie, which I doubt you have considered. If cigarette smoke can get from one apartment to another, a REAL FIRE could spread life-threatening smoke and flames just as easily! (OK, yes cigarette smoke will kill you too - but secondhand smoke takes a long time. An actual FIRE will kill in minutes.)
I don't know the exact rules, but there are some pretty strict rules in most areas about fireblock between apartments (so a fire in one apartment doesn't kill everyone else in the building before the fire department can get there), between residential areas and garages and probably other specific areas as well. This typically means that there are no openings between those areas where smoke and fire can easily get through and that all walls, doors and windows between those areas are "fire rated". That doesn't mean fire can never get through - the rules set minimum times for a fire of a particular temperature to be prevented from getting from one room to another, provided the doors, windows, etc. are closed at the time.
So if your landlord doesn't care about you smelling smoke, and doesn't care about wasting energy on heating & cooling (if there are gaps between floors I'll bet there are gaps to the outside as well), I'll bet the landlord would definitely care about being in violation of code requirements regarding firestops.
That being said, you don't need to confront your landlord or call the building department - neither tends to end well. But you may be able to get your landlord to pay for sealing the cracks, holes, etc. if they understand the importance of proper firestop.
Depends on the gap size and location. The danger with that foam is that it tends to drip, sag, and just generally get everywhere you don't want it to, and it is difficult to clean up. Would suck to foam some things and have a glob fall into his apartment and destroy something expensive. So depending on risk of that I'd use clear 100% silicone.
For larger gaps stuff them with backer rod (called "caulk saver" at big box stores, located with weatherization supplies) and caulk over that, and tool (smear) to contact adjacent structural surfaces using the tip of caulk tube, a putty knife, or your finger. As far as fire/heat, people foam gaps around baseboard heat ALL the time, never an issue. Even in steam systems you shouldn't see much or anything more than 212 degrees. There is a fire resistant foam though if you want to use it. Most silicone compounds also resist flame, to a point.