Yes of course you can. You just need switch on your wifi from your phone and you can connect to any of the available wifi signlas. Requirement is just that you must know the password(if set) of wifi or you can know the wifi password from near by people.
Another option to use internet on phone is to switch on data connection of smartphone and it will cost you some money which depends on the sim you are using.