I have gone through this document, but there it is given with managed image details
where to give computer gallery details in the template? where to give source image (existing image) and destination image (need to be created) details in template?
for example: in the given JSON template, I am not sure where to pass the values of compute gallery that includes: source gallery name, source VM image definition and VM version and then same destination details VM version details. I am going to create new image in the same gallery. For example from source gallery I take 1.0.0 image and then after packer does it steps I should see 1.0.2 in the same gallery

It's better to check Packer and azure plugin documentation instead of Microsoft docs about Packer
This is example how you can define base image from Azure Compute Gallery in JSON format:
https://developer.hashicorp.com/packer/integrations/hashicorp/azure/latest/components/builder/arm#shared-image-gallery