No, you won't be safe saving infected files into a external hdd and then reinfecting your self. Format your who computer and let got the files too.
How do I do to recover my wallet.dat in this case

?
your wallet data is worthless now, the scammer probably have sent your coins to another address
create another one after the format and this time, store your bitcoin in a second wallet.dat which you keep in a cold storage, and plug only in a safe machine