@Richa Kumari Thanks for posting in our Q&A.
Currently, there is no such setting can lock the wifi, but we can force devices to use Wi-Fi networks set up through Intune configuration profiles.
For iOS/iPadOS 14.4 and older devices, use the setting "Require joining Wi-Fi networks only using configuration profiles".
For iOS/iPadOS 14.5 and newer devices, use the setting "Require devices to use Wi-Fi networks set up via configuration profiles".
For more details, please read the following article:
https://learn.microsoft.com/en-us/mem/intune/configuration/device-restrictions-ios#settings-apply-to-automated-device-enrollment-supervised-12
Hope it will give you some ideas.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.