It is indeed pretty bad, I did this one time and the guy who I changed the offer on was fucking furious. Bad thing is, the company owner was someone who I wouldn't say I was exactly friends with it, but we weren't strangers. I was young at the time and didn't know better. On the other hand, it probably worked out better for me in the long run, but it was a dick move on my part and I still feel bad about it.
From the company's point of view, they could have actually already sent rejection letters to other candidates, cancelled interviews, etc because they have a candidate starting. Ultimately you have to weigh what's in your best interest and decide if burning that bridge and making that enemy is worth it for the other job.
Multiple job interviews / offers is always a tough situation to be in (although many out of work people would kill to be in that situation), if you think something like that is going to happen it helps to stall the first interview from even taking place for as long as possible. Once you have an offer, you can generally request a week to think about it, and some places may be kind enough to give you 2 weeks although it's rarer. If you tell the other company (the one that you really want to work for) that you have an offer in hand from another company and you have a hard deadline by which you must respond, they will often expedite the shit out of you. Assuming, of course, they're really that interested.
This happened to me in my most recent job search. I had an offer from one company, another company had literally *just* cold called me after I submitted my resume through their website. I told them that I didn't know if it was possible to get through the process quickly enough, hell I even lived in another state and they'd have to fly me out for an interview. And this is actually a major, major industry player, a big company, where bureaucracy is supposed to be king. But they fucking made that shit happen, flew me out the next day, had the paper in my hand 3 days later. I ended up accepting that one.
Anyway, in general, once you sign the paperwork, you should consider all other prospects as over.