yes an infected tooth (especially the molars) can cause a muscle-tension type headache. that does not imply however that the cause of your headache is a dental source -- there are many causes and types of headaches. you would need to consult your medical provider (or dentist) to make that association.
can a loose or infected tooth cause headaches