Dynamically prepend or append a path element to content urls?
The hooks that can actually change the links used from Drupal are hook_url_inbound_alter() and hook_url_outbound_alter().
I have never used them to alter a link basing on the URL of the currently viewed page, but in the case of hook_url_outbound_alter() that should not be difficult, as it would require to use arg(); in hook_url_inbound_alter(), it would be more difficult, since you would need to be able to understand in which cases you happened a string to the URL. If the added part comes from a vocabulary of taxonomy terms, that would be probably easier, hoping that the taxonomy terms don't cause any conflict with enabled modules.

Appending the term at the end of the URL would avoid conflicts. It would also be easier to understand when a URL has been modified from your module.