The key to checking such aggression early is in showing your dog who the boss is. You don't need to actually punish your dog to get that message across. The best way to demonstrate you are the boss is by establishing a consistent feeding schedule. Feed your dog only at certain preset times, don't deviate from your routine. Don't feed your dog anything in between meals, and get the cooperation of other household members who interact with your dog. In the event that your dog is too full to eat during mealtime, don't leave the food out, feed your pet again only at the next scheduled mealtime.
Establishing a rigid schedule will give your dog a clear picture of who dictates when and how much he or she eats. This is essential if you want to curb your dog's aggression while eating. A second important thing to establish is the order of importance; always feed your dog after your family and not before. If your dog begs at the table, don't allow him or her to be fed. Feed your dog after your family is finished eating. That way, the dog will understand his or her rank in terms of superiority in the house. This again will go a long way towards toning down your dog's aggression.
Giving table scraps is never a good practice for many reasons: First of all, it's unsanitary, your dog will probably end up taking the food away and trying to eat it somewhere else and wherever he or she does eat, it will be a mess after. Secondly, dog food is nutritionally balanced to be ideal for dogs, and scraps from the table will upset that balance. Third, it is disastrous from a behavioral standpoint, your dog will feel that you can be manipulated and this will upset your established schedule and undermine your credibility as the master. When feeding time does come around though, make sure that while training your dog, someone is there to watch him or her eat, this will also help drive home the point that people will not try to take away their food.
With young dogs the tips we've given should be enough to eventually eliminate this sort of aggression early. If however, you are trying to train an older dog, you may need to use and additional method: that of not giving the food all at once. Let your dog have a small amount, and when he or she finishes, give more, repeat until your dog has eaten the correct amount as prescribed by your vet, or the packaging of your dog food; that way your dog is more likely to deduce that you are a giver of food, not somebody who takes it away.
Aggression at feeding time is a primal instinct, after all, in the wild, dogs are largely predators, and their instinct is to defend their food against other predators. With patience and consistency though, your dog can be taught that he or she shouldn't misbehave at feeding time.