Yes, you can do this. You will need a charging device that regulates the alternating current of your dynamo to constant direct current. The manufacturer SON recommends the universal charger "USB-Werk" from Busch & Müller for USB devices that operate with low power consumption. Modern smartphones in browsing mode with the screen permanently lit need 2 to 4 watts of power.
Few charging devices are efficient enough to work with these devices. The most efficient devices, regardless of speed, are the "Forumslader V5" and the "NC-17 AppCon GT1".
In any case, care should be taken when charging during a bike ride: USB cables plugged into the smartphone during the ride can damage the charging socket due to shaking. Even otherwise splash-proof mobile devices can be damaged by rainwater if the rubber seal of the USB port is removed and the cable is plugged in instead. Under no circumstances should you let your smartphone or GPS distract you while driving!