There is an infection risk any time you open up your fermenter and especially when you throw stuff into it. If you dry hop at the right time you reduce that risk.
- The alcohol built up protects against infection
- The hops already in the beer act as a preservative
- The pH is unfriendly to new growth
- Most of the easy to eat sugars are already consumed
For these reasons, it is important to dry hop late in the fermentation. You need to allow alcohol and carbon dioxide to build up in solution to fight off invaders. Listen to the Dec 8, 2008 episode of Brew Strong for techniques and technicalities.
The same rules apply to many other fermentation additions. Other herbs and chips can be thrown right in. The more surface area the addition has - the more nooks & crannies - the larger risk of infection because there are more places for baddies to hide. I recommendI recommend soaking wood chips in alcohol of some sort, for example.