Yes, you can.
Depending on what you are developing, though, it would be different advice.
For something like a theme or plugin, it’s definitely the way to go. Get it all working and then FTP the files or install the theme or plugin on the live site.
But if it’s content, then the only files are media, and you would still need to add them into the database. The content itself is only in the database(no files). And there are differences in your options details in the database of local and live, so you can’t just export and import the whole database.
This is where migration plugins come in handy. This type of plugin will ask you for what you want to change in the database before you export the data, and then importing it works correctly. But only use this for total replacement, because it’s a lot of data (plugins usually pack up the files too).
There are other plugins that just do import/export on content, but you have to be careful about whether it will add duplicates or update the old ones.
There are other plugins that help you make mass changes (like for store inventory) in an interface much like a spreadsheet, and still others that export to CSV so you can use a spreadsheet program to edit and then import using update (no duplicates).