Hi Sergio,
Yes, you can test SAML module with localhost,
You have to update SP-Metadata(localhost URLs) in IdP.