Hello Pratima Patil
I understand that you are looking to Enabling Internet Access for VNet A via NAT Gateway in VNet B.
If you want to use the same NAT Gateway for VNet A and VNet B, it is not possible by default. A NAT Gateway is designed to be associated with only one VNet and can be linked to multiple subnets within that VNet.
Note: NAT gateway does not support association with multiple VNET's.
To achieve this functionality, consider using a Network Virtual Appliance (NVA) as outlined in the documentation below.
You need to deploy the NAT Gateway, then deploy the NVA in the NAT Gateway VNET. Configure to ensure that all traffic from the spoke VNETS is routed through the NVA. You can configure the NAT Gateway to handle all outbound internet traffic from both the hub and spoke VNETS. Finally, validate the setup by testing the NAT Gateway and ensuring proper routing between the hub and spokes.
Kindly check the below public document for more understanding:
https://learn.microsoft.com/en-us/azure/nat-gateway/tutorial-hub-spoke-route-nat?tabs=portal
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.
If you have any other questions or are still running into more issues, let me know in the "comments" and I would be happy to help you.