Can a word countability change when you are able/unable to count it?
Mass nouns can be converted to count nouns, and vice versa, but the example you give for "a sugar" is not likely to be heard from a native speaker.
Despite the terminology, "count nouns" aren't only or even particularly used in situations where it is possible to count the number of objects. They can be used to refer to a vague or unspecified number of objects, as in the sentences "Dogs are related to wolves" or "I'm going to pick berries this afternoon." And "mass nouns" can refer to clearly countable objects; for example, "The only furniture in the room was a bed, a desk and a chair."
Converting mass nouns to count nouns
Most commonly, when a mass noun (let's call it "X") is converted to a count noun, the meaning of the resulting count noun is "a type of X." "Sugars" is in use with the meaning "types of sugar." "A sugar" is in use with the meaning "a type of sugar" (for example: "glucose is a sugar").
This is a chemical digram of the structure of glucose, "a sugar" (there are other sugars such as fructose and galactose)
Another use of mass nouns converted to count nouns is to refer to servings of consumable items. "A water" is the classic example; it can mean "a serving of water" (for example: saying "We'll have two lemonades and a water" to a server at a restaurant). Since sugar doesn't generally have a standard serving size, you are unlikely to hear "a sugar" with this meaning. The only situation where I can think of where "a sugar" might occur in a food context is as shorthand for a unit of sugar that is put in a beverage; e.g. a packet of sugar, a spoonful of sugar (as Ricky mentions) or a sugar cube (as chrylis mentions) (example: "I started by just having half a sugar in my tea, and each time I’d put in a bit less," from "I Quit Sugar with Sarah Wilson").
This could conceivably be called "a sugar" in a situation where you're talking about putting it in a beverage
English speakers rarely convert mass nouns to count nouns to indicate "a small amount of something" or "a particle of something." Instead, we usually use a separate count noun that is a unit of measure, followed by "of" and then the mass noun, the way you used "grain" in your post: "a grain of sugar," "a drop of water."
Converting count nouns to mass nouns
"Much people" is also unlikely to be used. The word "people" is complicated and can be used either as the plural of "person" or as a singular count noun in its own right meaning "a group of people; a population". But neither use sounds natural with "much."
The usual context for converting a count noun to a mass noun is not just "a bigger amount than you can count at a glance." Usually, conversion only occurs in contexts where it is impossible in principle, not just practically, to distinguish different objects. For example, I couldn't easily count a million peanuts, but they would still be called "peanuts."
But if those peanuts were all shelled, ground up and baked into a food product, it's possible to use "peanut" as a mass noun to describe the ingredient in a sentence like "Reese's Peanut Butter Cups have chocolate on the outside, and peanut on the inside."
Here is an example I found on Google Books of "peanut" being used as a mass noun in this way:
The federal Food Allergen Labeling and Consumer Protection Act (FALCPA) requires that any packaged food that contains peanut as an ingredient must list the word peanut on the label as described in the labeling requirements. (ALLERGIES: The Complete Guide To Diagnosis, Treatment, and Daily Management, by Bruce S. Dobozin MD. & Stuart H. Young)
It's not generally necessary to convert a count noun to a mass noun even in this situation. Actually, to me "contains peanuts" sounds a bit better than "contains peanut," but both are possible.
How many sugars, one or two?
This usually means "How many spoonfuls of sugar?"
That's an exception, though. Normally, sugar is not countable.
The word for an uncountable mass of humans isn't people; it's populace, or proletariat, if you will.
How much populace was there at the event?