It's very UNLIKELY to infect your beer through dry hopping. If it were anything other than that you would see countless threads telling folks not to DH. But like so many fear of infection hypochondria it's pretty unfounded. It's really difficult to infect/ruin your beer, and true infections are
rare.
What most new brewers think is an infection usually turns out to be their fear and paranoia, and not knowing what normal fermentation looks/smells/tastes like.
In terms of dry hopping you are adding hops to ALCOHOL...at that point fermentation should be complete, and therefore they are being dropped into alcohol, which is not something that can usually harbor and infection.
Secondly hop are an antiseptic, they usually prevent infection not cause it.
Thirdly, most of the time the hops are in sealed, vacuumed containers, so again there shouldn't be anything nasty in them.
I've always ever just dumped them in and have never had an issue.
Here, read this,
Revvy's advice for the new brewer in terms of infection worry. You might find the info and advice helpful....