Yes! You can transfer a WordPress site from one localhost to any other. Export your database from first localhost and then import it on the second localhost server.