Vimal Kumar A R, Thank you for posting this question on Microsoft Q&A.
No - The Azure Arc VMs and Log Analytics workspace (to which these VMs will be connected to) need not be in the same Resource group.
Hope this helps.
If the answer did not help, please add more context/follow-up question for it, and we will help you out. Else, if the answer helped, please click Accept answer so that it can help others in the community looking for help on similar topics.