Multiwavelength observations toward protostars reveal complex properties of thermal dust polarization, which is rather challenging to interpret. Yet a detailed study of grain alignment mechanisms responsible for dust polarization in such environments is still lacking. Here, we study the physical processes inducing the alignment of the grain axis of maximum inertia moment with the angular momentum (J, i.e., internal alignment) and of J with the magnetic field (i.e., external alignment) of very large grains (VLGs, of radius a > 10 µm) using the grain alignment framework based on radiative torques (RATs) and mechanical torques (METs). We derive analytical formulae for critical sizes of grain alignment, assuming that grains are aligned at both low−J and high−J attractors by RATs (METs). For protostellar cores, we find that super-Barnett relaxation can induce efficient internal alignment for VLGs with large iron inclusions aligned at high−J attractors by RATs (METs). In contrast, inelastic relaxation can be efficient for VLGs made of any composition. For external alignment, we find that VLGs with iron inclusions aligned at high−J attractors can have magnetic alignment by RATs (B−RAT) or METs (B− MET), enabling dust polarization as a reliable tracer of magnetic fields in such dense regions. Still, grains at low−J attractors or grains without iron inclusions have alignment along the radiation direction (k−RAT) or gas flow (v−MET). For protostellar disks, we find that super-Barnett relaxation can be efficient for grains with large iron inclusions in the outer disk thanks to spinup by METs, but inelastic relaxation is inefficient. VLGs aligned at low-J attractors can have k−RAT (v−MET) alignment, but grains aligned at high−J attractors have likely B−RAT (B−MET) alignment. Grain alignment by METs appears to be more important than RATs in protostellar disks. Detailed modeling of dust polarization accounting for the present effects is crucial to explaining diverse polarization and probing dust properties toward protostellar environments.