Yes, you can, but make sure your machine meets the system requirements:
When you upgrade, you need to do the following:
1) Check all your software for compatibility with the new system.
3) Make a full backup of your whole system using Time Machine.
4) Ideally, make a second full backup of your whole system using something else, like Carbon Copy Cloner. (I consider two backups to be the minimum.)
5) Wait until you have time to deal with any possible problems that crop up.
6) Install the upgrade.
Some people recommend erasing your hard drive and installing the new system "cleanly." That certainly helps ensure that you don't have any problems with the new system, but is often unnecessary. I prefer to save clean installs for when they are actually necessary, but that is only an opinion. You can certainly choose to do a clean install if you prefer.