We investigate the dynamics of a number of f(R) theories in the background of the spatially homogeneous as well as isotropic Friedmann- Leimaitre- Robertson-Walker (FLRW) model and anisotropic Bianchi type I and V models in Palatini formalism using the dynamical systems approach. Considering theories of the type f(R) = R + gamma R-m - beta/R-n, it is examined whether this model is capable of allowing all four phases of cosmological evolution or not. Additionally, we have performed the analysis for f(R) = R + gamma R-2, as these theories have attracted great attention in recent years. For the theories of the type f(R) = R - beta/R-n, the sequence of the radiation-dominated, matter-dominated, and accelerated expanding epochs has been reproduced. In the case of anisotropic models, the evolution of the anisotropy parameter, i.e., the shear, is also investigated, where it is found that the initial anisotropic Universe evolves to a stable accelerated expanding Universe. Moreover, corresponding to the Bianchi type V model, the evolution of spatial curvature is also investigated.