Is there any way to simulate a program run before burning it onto the board?
There are a few Arduino Simulator projects out there. 

Perhaps one of the more mature ones is the Virtronics Simulator for Arduino, YouTube video here.



The Virtronics page linked above also lists a few other Arduino simulators, both free and paid. 

Given the interest the Arduino evokes, there are likely to be many more such simulators out there, so no point trying to list them all in an answer here.

What is worth noting is that there is also an Arduino Simulator iPhone app: This is not a recommendation, not having seen it in operation yet. 



On a side note: 

The Arduino is in itself a prototyping / experimentation board. It is ideal for programming experimental code, debugging it, modifying and then re-flashing fresh code, pretty much as many times as one likes. If the code hangs, reset and reflash with any changes.

Therefore, the merit of using a simulator, which can never perfectly emulate the various real-world timing or other issues an application might face, is questionable. 

If the cost of the Arduino is the concern, there are a couple of options open:


Inexpensive Arduino Nano clones off eBay - I have several Meduino Nano Enhancement boards, they work excellently, and are priced at under $10 including world-wide shipping:

Make your own Arduino - The Arduino site walks you through making one on a breadboard, which does not even need you to solder anything!