I can’t speak to the overall safety one way or another but for many years that was the only way to have an Apple ID, I used an @mac.com email for iCloud until they permitted changing your email address few years ago, now it uses my gmail address as you are doing.
As for safety, no matter which you choose, make sure you have 2 factor of some kind enabled on both the email and your Apple ID, that will make a bigger difference in my opinion.