Dynamic URL generated by a custom field dropdown value
In the section settings, you can specify a dynamic entry URI format.
As the docs say, this box is in fact a mini Twig template, and is preloaded with the element being saved (accessible as object) and its custom fields (accessible directly by their handles). Good to know that you can also use a shortcut syntax with single braces instead of double ones here.
So in your case you'd want something like:
{slugPrefixFieldHandle ? slugPrefixFieldHandle ~ '/' ~ slug : slug}