You can dynamically provide values for the resource path dynamically in the operation (eg see How to Build a POST Request for a REST Endpoint with Replacement Variables) but you cannot override the base URL in the connection.
Can you please elaborate on your scenario?
To add some points: Mohammed Akram
I'm also curious to know what really you are trying to achieve.
Retrieving data ...