Can iPhones connect to the internet without using someone's Wi-Fi?

While in a restaraunt, my friend's iPhone wasn't able to connect to the internet. When she came to my house and used our Wi-Fi, it worked fine.So, is the phone not capable of connecting to the internet on its own?

She has to turn on cellular data on the settings

Your question makes no sense.
iPhone ==> Wi-Fi ==> Internet

Without Wi-Fi= no Internet.
Unless. Of course, you have 3G

Could be you're in a 3G or 4G deadzone (depending on the phone). Usually it's not a problem for the iphone to connect to the 3g network when it's outside of Wi-Fi range.