Yes, you can clone a hard drive using the built-in Disk Utility tool or other third party tools. But the cloned hard drive will only be able to boot the new machine if the new machine is capable of booting from that OS. So if you were running Lion on your current machine and never went to Mountain Lion, and then you bought a new machine that comes with Mountain Lion pre-installed, your cloned Lion image wouldn't work on the new machine, since the new machine requires Mountain Lion.
Often a better solution than full hard drive cloning is to use Migration Assistant. Apple provides Migration Assistant functionality built into the first-time boot assistant of OS X (so one of the first few screens you see when you boot a new Mac or do a clean reinstall of OS X), and it's also available as a standalone app at
Migration Assistant walks you through getting all your system settings, files, and apps migrated from an old machine to a new machine, or from a time machine backup to a new machine, or whatever. It saves you from having to do a full clone, and it allows you to migrate from a machine running an older OS to one running a newer OS.