The reason people think forex is a scam is because many countries do not have laws that govern how forex brokers operate, and who can parade themselves as a forex expert.
When you go online, you see all sorts of characters selling courses and giving trading/investment advice even without having the requisite educational qualification to back it up.
So, these are part of the reasons people think forex is a scam. But the reality is forex trading is not a scam.
Knowing how to trade is not enough, you need to have self-control over emotions like greed and fear, and this is where most people fail. When they cannot succeed in becoming steadily profitable in forex, they resort to becoming scammers and selling lies to others.
If there were laws that govern forex trading in every country, most of these people you see online claiming to be forex gurus will disappear. For example, in the United Kingdom where there are laws governing forex, you cannot just come out and start selling signals and dishing out investment advice without being licensed by the UK government, you will be arrested.
You are free to trade on your own, but when you start selling signals and giving investment advice to people then some countries (like the UK) will require you obtain a license.