The base isolation technique is a well-known strategy used for the seismic protection of structures. It introduces a highly deformable device between the structure and the foundation to isolate the main structure from the ground motions. Despite the continuous enhancement of base isolation techniques, the limitations of this strategy are well known to researchers and engineers. Base isolation systems undergo large displacement under strong earthquake motions, which usually results in structural damage and users’ discomfort. In this study, a magnetorheological (MR) damper is used to improve the performance of a benchmark base-isolated building by placing the MR damper between the base of the structure and the foundation. The soil-structure interaction (SSI) effect is included in the study by considering three types of soil, denoted dense, medium, and soft. The soil is introduced through two degrees of freedom, namely, sway and rocking, based on the cone simplified linear model. The MR damper parameters are optimized using a particle swarm optimization (PSO) algorithm under a set of benchmark earthquake records. The optimal local parameters related to each benchmark earthquake and soil type are averaged to obtain general optimum parameters. The acquired general optimum parameters are then used to study the dynamical response of the benchmark base-isolated building controlled by the MR damper, considering an array of 100 natural earthquake ground motions. The obtained results show an enhancement of the dynamic response under all soils conditions compared to non-optimized and base isolation only scenarios. Several engineering demand parameters (EDP) and response indicators were investigated in this study, including top floor and base displacements, inter-storey drift, storey drift, top floor acceleration, and base shear. The results obtained show the effectiveness of the optimization in improving the response of base-isolated structures. It also demonstrates the dependence of damper parameters on soil typologies.