The aim of this paper is to analyze the nature of anisotropic spherically symmetric relativistic star models in the framework of f (R, T) gravity. To discuss the features of compact stars, we consider that in the interior of the stellar system, the fluid distribution is influenced by MIT bag model equation of state. We construct the field equations by employing Krori-Barua solutions and obtain the values of unknown constants with the help of observational data of Her X-1, SAX J 1808.4-3658, RXJ 1856-37 and 4U1820-30 star models. For a viable f (R, T) model, we study the behavior of energy density, transverse as well as radial pressure and anisotropic factor in the interior of these stars for a specific value of the bag constant. We check the physical viability of our proposed model and stability of stellar structure through energy conditions, causality condition and adiabatic index. It is concluded that our model satisfies the stability criteria as well as other physical requirements, and the value of bag constant is in well agreement with the experimental value which highlights the viability of our considered model.