Can I replace a 20A breaker with a 40A breaker?
Never EVER swap a breaker for a larger amp.  Extremely dangerous and could easily burn your house down.  If turning on a space heater trips the breaker, there are other things on the circuit drawing current and you will need to shut them off to run your heater on that same circuit.  Also use the lowest wattage setting whenever possible - running 1500 watts (high power) all the time... no telling how warm/hot the wires inside your walls are getting.  If you have an industrial (high-amp) extension cord, you could use it to run your heater from another circuit, or even add a second heater to the basement using the heavy-duty extension cord. (Do NOT use a normal household extension cord to power a heater though!!!).  I'd suggest a kerosene heater to get you through really cold temps - they are great emergency heaters.  Or an oil-filled dielectric radiator heater (those are safer than most).