Modified gravity versus shear viscosity: imprints on the scalar matter perturbations