Your profile doesn't show which state you're in. Different states have different game laws and requirements. In general, most states require a hunting license to hunt tree squirrels and usually have a season when you can hunt them, bag limit (# you can kill and keep), types of weapons that can be used to take (hunt and kill) the game animal, etc. Before hunting squirrels, you should consult your particular state's game laws and make sure you're doing things legally.
Your question about lead pellets is a good one that many first time hunters ask. It is safe to kill your game (in your case squirrels) with lead pellets, bullets, shot, etc. You'll want to chew carefully if you haven't found your pellet when field dressing your squirrels as lead can be a little hard on the teeth. It's not a 911 call if you accidentally ingest (swallow) a lead pellet as it will likely come out within a day or two in your waste. You don't want to use cans of lead pellets as snacks but an occasional pellet or bird shot surely isn't going to kill you. Now if you have some extreme allergy to lead, you may want to consult with your regular doctor who handles your allergies.
If you're still concerned about using lead, perhaps you should use head shots where the lead pellets don't come into contact with the squirrels body and meat. Or use you non-lead pellets. As for why manufacturers use lead in pellets, bullets and shot, it's simple. It's an extremely effective choice for projectiles and it doesn't tend to poison people from accidental occasional ingestion. Hopefully all of this information helps some.