It depends on the child.
If the child is dependably responsible and the gun is treated not as a toy but as a training for future gun ownership, then yes. The pellet gun should be secured like a firearm, and the child should be supervised until the parent is certain that he can be trusted to use it responsibly.
Future gun ownership should proceed with a single shot .22 rifle, perhaps with a clip to be added later.
After a long line of guns I graduated to this.
Start small, dream big.