If I invest in a popular project does that make my money safe from scams or popular projects can turn to scam as well?
If it's only driven by hype then there is a high chance for it to become a scam. You should not only base on the projects' popularity when you want to invest on it. You should also check its background like who the developers are or checking its roadmap or utility to see if it has a potential.
Just look at shitcoins now, they were very popular last year even if many of them have no real utilities. Many people bought them because it was hyped on the social media. Now their value is worthless and its developers already abandoned their project.