Yes, as long as it is an approved container and you are using it in accordance with the manufacturer's instructions. You may not dig a pit or have any sort of bon or camp fire. The outdoor fire pit is a device that contains the fire and has a screen installed to prevent flying embers.
If you do choose to use a fire pit during the summer fire season and it causes a wildfire, you could be held liable for any damages plus the cost to fight the fire. So use the fire pit with extreme caution, have a charged garden hose ready to use, and fully extinguish the fire before leaving the area. Do not deposit ashes in the trash can. Hours later, this can lead to a smoldering fire that eventually consumes the garbage can and anything nearby, such as the wall of your home or garage.