You can ALWAYS get out of a contract. The question is: How much will it cost you to get out of the contract? As a general rule, if neither side has invested anything into the contract, then you can get out with just a notice. But chances are that the dealer will show that they have invested in this contract and if you back out, you are liable for any of their investments.
If you drove the vehicle off the lot, it will cost you plenty. If the dealer has already registered it in your name, you will be liable because it is now a used car. But the sooner you contact the dealer with your intentions, the less it will cost you.