Tampered cables or USB sockets in hotels, buses or trains could read out data or install unwanted software. If you are not sure, you can simply switch off your phone for the charging process. This way, nothing can be installed or read out and it will still charge.
If possible, use a USB cable without data function for charging. Some electronic devices are supplied with USB cables that can only charge. They lack the necessary data wires inside. You can check any cables you have by trying to connect your phone to a computer. If that doesn't work, the cable is a charging-only cable. You can then mark it and use it safely with all other charging plugs and sockets.