Is it safe to use DC power that you got from main lines for basic circuits?
Do not believe markings on any chargers sourced through non-standard supply chains!! For example, Ali, eBay or your local dollar store. 

Many are criminally unsafe and can kill you. I have seen creepage distances of ~1mm (should be 8mm+) and metal debris rattling around inside of something marked with fake safety agency approvals and fake Apple "Designed in California" and green dot markings. Printing ink is cheap. 

You spend $1-$2 for a USB charger you do NOT get the quality (and more important safety) of an Apple or even Belkin charger. You get Shenzhen street sweepings, which is not acceptable for a device that is safety-critical. 



If the USB charger is approved and of good quality there should be no more danger  than with using any other mains-powered device. Better ones have OVP protection to protect your circuit in case of a failure of the charger. Most should be short-circuit proof and provided you don't apply any outside voltages to the output should be reasonably robust.