No, online slots are not a scam. However, online slots have a built-in house edge. In the long run, you're likely to lose more than you win while playing them. That's why every player takes a conscious risk playing them. Just like any other form of gambling, you shouldn't play with money you're not prepared to lose.
Slots are built to be as unpredictable and random as possible. Every spin is a random event, completely independent of the results of the previous rounds.
This unpredictability is powered by a random number generator (RNG). Every RNG in use on licensed markets such as the UK is tested and authorised by independent testing agencies to guarantee fair play.
Some game providers have also been in the business for decades, which is hard if you scam your players. For example, there are still new Microgaming casinos popping up, and Microgaming has been around since 1994.