First of all, I never hand a dog a treat with the treat between my thumb and first finger. That's just asking to be bitten, scraped, scratched, pinched, etc.
Instead, I put the treat in my palm and hold it with my thumb, and hand the treat that way.... as if giving a treat to a horse.
Very few dogs will bite your hand if you give the treat this way.
If you still have a greedy dog, what I do is hold the treat in my fist so they can't get to it, and hand it to them. If they bite at my hand, it stays closed. When they back away or lick my hand, I open it and give them the treat. It is very painful the first few times you do this, and you have to be extremely consistent and do it EVERY TIME, but eventually the dog will learn to be a little more patient and show some self control.