The other question can be asked: How safe is my dog if it ends up at a shelter with no collar, and is euthanized or adopted out because I chose not to implant inexpensive, permanent identification?
Our clinic has chipped thousands of dogs over 35 years. We have not seen any ill effects. Yes, a non-sterile chip could introduce infection, but our chips are sterile. Handled properly, there should be no problem. The bigger problem is the pet owner who chips their dog or cat, then forgets to update contact information when moving. You invested in the identification, but can't be contacted when your pet runs off years later and is found and scanned.
The microchip is an unpowered transponder encoded with a serial number (RFID tag). When a handheld scanner at the right frequency bounces a signal off of it, the number shows on the display. The American Animal Hospital Association maintains a great website that most often can identify the chip manufacturer by the number, and often can query the appropriate registry and return your contact information. Some registries require a phone call. If your pet is chipped, make sure you keep the registry contact information current and don’t worry about any other registries… only that provided by your chip’s vendor.