Hi, naveed.ahmed!
Hope you're having a good day so far.
First, you should check if the wazuh master node and the worker node must have a connection, that can be either by an internet connection or by a local network connection.
After that, please check the status of the cluster by running the command: /var/ossec/bin/cluster_control -l
If there is a proper connection and the cluster status seems to be right, you can proceed to register the agent. As for answering your question, a worker node is not able to generate auth keys for the registration process, however, the registration process can be executed in a worker node with minor issues because the node will receive the registration petition and send it to the master node. The master node will generate the registration key and send it back to the worker and complete the registration process.
If you need more help with the registration process, please share the script that you are using and the ossec.log file from the wazuh agent that you are trying to register.
Hope this answer can help you
Regards,
Fernando Lojano Mayaguari