Contrary to the popular myth, memory foam does not burn easily. 
It contains fire retardant and is resistant to open flame.
However, just like any other fabric, it’ll burn when exposed to direct fire.