Is it ever that a pinhead sized cavity cause swollen jaw gland on that side and pain?

Yes. What you see on the outside, a 'pin head' size lesion, may be enormous underneath where you cannot see, inside the tooth. We see this all the time. A radiograph is used to determine the extent of the decay. It may be so deep that the nerve has been affected, and it seems that way from your symptoms. Go see a local dentist for treatment.