Epigenetics is a driving force of important and ubiquitous phenomena in nature such as cell differentiation or even metamorphosis. Opposite to its widespread role, understanding the biophysical principles that allow epigenetics to control and rewire gene regulatory networks remains an open challenge. In this work we study the effects of epigenetic modifications on the spatial folding of chromosomes—and hence on the expression of the underlying genes—by mapping the problem to a class of models known as magnetic polymers. In this work we show that a first order phase transition underlies the simultaneous spreading of certain epigenetic marks and the conformational collapse of a chromosome. Further, we describe Brownian dynamics simulations of the model in which the topology of the polymer and thermal fluctuations are fully taken into account and that confirm our mean field predictions. Extending our models to allow for nonequilibrium terms yields new stable phases which qualitatively agrees with observations in vivo. Our results show that statistical mechanics techniques applied to models of magnetic polymers can be successfully exploited to rationalize the outcomes of experiments designed to probe the interplay between a dynamic epigenetic landscape and chromatin organization.