Context. The polarized dust emission observed in Class 0 protostellar cores at high angular resolution with ALMA has raised several concerns about the grain alignment conditions in these regions. Aims. We aim to study the role of the radiation field in grain alignment mechanisms that occur in the interior (≤1000 au) of Class 0 protostars. Methods. We produced synthetic observations of the polarized dust emission from a magnetohydrodynamic model of protostellar formation using the POLARIS dust radiative transfer tool, which includes dust alignment with radiative torque alignment (RAT). We tested how the polarized dust emission from the model core depends on the irradiation conditions in the protostellar envelope by varying the radiation due to accretion luminosity propagating from the central protostellar embryo throughout the envelope. The level of grain alignment efficiency obtained in the radiative transfer models was then compared to (sub)millimeter ALMA dust polarization observations of Class 0 protostars. Results. Our radiative transfer calculations have a central irradiation that reproduces the protostellar luminosities typically observed toward low- to intermediate-mass protostars, as well as super-paramagnetic grains and grains ≥10 µm, which are required to bring the dust grain alignment efficiencies of the synthetic observations up to the observed levels. We discuss the characteristics timescales of the grain alignment physics together with the radiative torque disruption (RATD) of grains and the typical time variability of accretion occurring in Class 0 protostellar cores. In our model, during an accretion burst or a steady-state phase of high luminosity from the protostellar embryo, RATD could have enough time to disrupt the largest grains in irradiated regions. Finally, in high-luminosity conditions (with L★ ≥ 20 L⊙ in our model), we find that the alignment of grains with respect to the anisotropic component of the radiation field (k-RAT) could drive inefficient alignment for grains ≳10 µm. However, given the high grain alignment efficiency observed in protostellar envelopes, large grains are most likely aligned with the magnetic field and thus potentially subject to rotational disruption, depending on their tensile strength. Conclusions. Our radiative transfer calculations show that irradiation plays an important role in the mechanisms that dictate the size range of aligned grains in Class 0 protostars. Regions of the envelope that are preferentially irradiated harbor strong polarized dust emission but can be affected by the rotational disruption of dust grains, thus controlling the population of the largest aligned grains. Episodes of high luminosity could affect grain alignment and trigger grain disruption mechanisms.