"It would be rude to say no"
Some of the sugar in your week doesn't come from your own tin at all. It's offered to you. There's the plate of biscuits that comes out with the tea at your neighbour's, the colleague going round the office with a box of chocolates, the friend who says "go on, keep me company" over the dessert menu. In these moments the biscuit is mostly a gesture between two people, and refusing it feels like turning the person down.
That feeling is worth respecting. Offering food is one of the oldest ways people have of being friendly, and accepting it is one of the oldest ways of being friendly back. A book that told you to sit in your neighbour's kitchen reciting rules about free sugars would deserve to be thrown across the room.
But look at what the gesture consists of. Your neighbour wants you to feel welcome and wants to feel that she's looked after you. Those wishes are met by your sitting down, accepting the tea, saying how nice it is to see her and staying for half an hour. She isn't counting biscuits. If you say "Not for me, thanks, but I'd love another cup of tea", you've accepted her hospitality in full. Most hosts won't register the refusal, because people pay far less attention to what others eat than we imagine when we're the one refusing.
It helps to have a few phrases ready, since the awkwardness is mostly in hesitating. "Not for me, thanks" works nearly everywhere. "I'm all right, thank you, I've not long eaten" is always acceptable. "They look lovely, I'll take one for after my lunch" works well with a colleague's box of chocolates, and it fits the rule too. None of these needs a reason attached, and I'd advise against giving one. Once you say that you're cutting down on sugar, people start talking about your eating. Some will take it as a comment on theirs.
Then there are the times you should simply say yes. If your friend has baked a cake for your visit, eat a slice and enjoy it. That's an occasion, in the sense the rule uses, because it has a date and a person attached to it, and it won't happen again tomorrow. The rule is aimed at three unthinking uses a day. A slice of Margaret's lemon drizzle doesn't come into it.
The line I'd draw is between something offered to you in particular, as a kindness, and sugar that's simply present in the room. The first is part of a friendship and deserves a generous response, which may or may not involve eating it. The second is another tin, even though it isn't yours.
The "go on, keep me company" kind of pressure is a special case. When someone urges you to have a pudding so that they don't have to have one alone, they're asking you to share their own mixed feelings about it. You can keep them company with a coffee. If they're a good friend, you might one day tell them about the three jobs.