Hi @Divyanshu Raj,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
Yes, correct. If you want to create a custom image from a VM in a VMSS, you will need to deploy another VM separately and attach it to the existing VMSS. Then, you can customize the VM, generalize it, and create an image from it. Once the image is created, you can use it to create new VMs and VMSS.
Firstly, remove machine specific information by deprovisioning or generalizing a VM before creating an image by going through this https://zcusa.951200.xyz/en-us/azure/virtual-machines/generalize.
The best way to achieve the above expectations- Create and use a custom image for Virtual Machine Scale Sets with the Azure CLI
If you have any further queries, do let us know. We are happy to assist you!