Despite the similarity in both the spelling and the meaning of the words, they really are quite different.
"Customer" refers to people who come into a store or another business and buy things.
"Consumer" is a slightly formal, technical word. It is a word in economics. It is one of a set of contrasting words: "producer," "distributor," "consumer."
Think of, let's say, apples. They are produced by apple growers, on apple trees, in orchards. That is the origin. That is the beginning. That is where the food comes from. That is "production."
The apple grower collects the apples from the apple trees, puts on trucks, and they are carried to supermarkets and grocery stores. That is "distribution." It's not production, because the supermarket didn't make the apples. It's not consumption, because the supermarket didn't eat the apples.
I go to the supermarket, and buy apples and eat them. (I'm actually eating one right now, a delicious SweeTango variety). That's the end of the apple. It has been consumed. I am the "consumer."
From the point of view of the supermarket, I am their customer.
From the point of view of the apple industry, I am the consumer.
I hope this isn't too complicated, but notice that from the point of view the apple grower, I am not their "customer." I didn't buy any apples from them. The supermarket chain bought the apples. The supermarket chain is their "customer."