You also need to be sure that the USB socket you have chosen will fit into the existing back box. Some makes need a deeper back box, or spacers around the front to accommodate the USB charger circuitry. Have you had a look inside the proposed socket you want to change? If it is one that has already got extra wiring in the back, e.g. another spur branched off that socket it can be very fiddly or impossible to get all of the wiring back in place with the new socket. Even with a standard exact like for like replacement sometimes wires have been cut ridiculously short by the previous person that getting a good secure connection is very difficult.
Remember the a key rule; "Electricity ALWAYS generates some heat whilst passing through a circuit, and poor connections bad joints, lose terminations with generate more heat and cause problems in the future, although it may appear to work at first". So yes you are legally allowed to do the work you propose. But make sure you have a enough depth in the back box, length on the cables and space to work. You may also need some longer faceplate screws and a re-threading tool for the back-box lugs.
Doc H.