You can test anything with anything - but you need to know what you are looking for. Spectrophotometers come in all shapes and sizes - what do you hope to find with this tool? It is generally not a good general tool for finding low concentrations of specific substances in complex matrices.
If you want to look for heavy metals (which ones?), ICP-MS would be the method of choice. But sample preparation is necessary (you can't nebulize a red pepper), so you'll need at the least a good hot plate, some concentration high grade acid, and a fume hood. Better would be an ashing oven and better than that would be a microwave digester. There are contract labs that will do this kind of thing.
Organic contaminants can also be analyzed, but here specifying what you want to find is even more important. Pesticides? Which ones? LC/MS or some variation is probably what you'd want to use, but broad "I want to find out if anything is in there" studies are pretty unrealistic.