Thanks for reaching out to Adobe Community.
Please go through the below article to know about how to configure replication agents:
http://docs.adobe.com/docs/en/cq/current/deploying/replication.html#Configuring your Replication Agents
I am not sure if CQ allows to create replication agent dynamically but why do we have to create it dynamically ?? Can you please let us know the usecase