Specify which template/layout to use based on URI segment
I'm not completely sure about what you're asking, but you might want to look in to craft.request:
 https://craftcms.com/docs/templating/craft.request

In your structure template, you can check your URL segments, and use twig include to load the desired template, based on those segments. 

Another related feature is dynamic routing:
https://craftcms.com/docs/routing#dynamic-routes

You could use this to route a URL to a different template.