Flat bands play a central role in the presence of correlated phases in moir\'e and other modulated two-dimensional systems. In this paper, flat bands are shown to exist in uniaxially periodic strained graphene. Such strain should be produced for example by a substrate. The model is thus mapped into a one-dimensional effective Hamiltonian and this allows to find the conditions for having flat bands, i.e., a long-wavelength modulation only on each one of the bipartite graphene sublattices, while having a tagged strain field between neighboring carbon atoms. The origin of such flat bands is thus tracked down to the existence of topological localized wavefunctions at domain walls separating different regions, each with a nonuniform Su-Schriffer-Hegger model (SSH) type of coupling. Thereafter, the system is mapped into a continuum model allowing to explain the numerical results in terms of the Jackiw-Rebbi model and of pseudo-Landau levels. Finally, the interplay between the obtained flat bands and electron-electron interaction is explored through the Hubbard model. The numerical results within the mean-field approximation indicate that the flat bands induce N\'eel antiferromagnetic and ferromagnetic domains even for a very weak Hubbard interaction, while the repulsive Hubbard interaction results in an effective electron-electron attraction. Thus this paper provides a simple, analytically solvable but realistic model to understand the physical origin of flat bands, pseudo-Landau levels and their effects on the effective electron-electron interaction.