Electric space heaters consume 1500 watts of electricity on high and draw huge amperage.
A cheap extension cord is likely 16 AWG and is unable to handle the amount of power that is being consumed by the space heater.
You should also never plug in a space heater into a power strips as they will melt with the space heater usage and cause a fire.
I once had a space heater plugged into a power strip and I started smelling burning plastic and looked at my power strip and the power strip was melted.
You could likely use a heavy duty extension cord with the space heater but it's best to plug the electric space heater directly into an electrical outlet.
Make sure the plug fits snug into the electrical outlet and is not loose as a loose connection can cause the plug to overheat and start a fire.