Is it bad to accept an offer and then later refuse it for another one?

I currently have a rather small deadline to accept an offer from a company, but I'm still in the interview stage with another. Ideally I'd like to have both offers at the same time but it looks like that's going to be impossible. Could I accept the offer from the first company and then later rescind it if I get a better offer from the second company?