I play D&D with my friends, and our DM sent us on a quest to poison someone with wine. It turns out there was a bomb on the bottom of the bottle, which exploded and killed us all. Are there any rules against just creating random weapons such as bombs like this? Also am I just being butt-hurt about it, or is it very cheep and a stupid way to kill all your players.
Are there limits to what a DM can do? Yes and no.
Yes, there is a limit, which is the limit of what you will all put up with before making an issue of it and refusing to keep playing his game.
But also no, because you might not ever reach your personal limit and could just keep playing despite not having fun. People are notorious for hanging onto the hope that a game might become fun again long after they should have quit.
So, the limit of what a DM can do is entirely up to you as a player.
Whole world (and the story) is controlled by DM. If he wants to kill you by saying "there was a bomb in the wine bottle", "whole building collapsed with you inside" or "remember that meal 3 nights ago? It was poisoned. Also, you've got Black Plague." - he CAN but...
It's a very poor DM
If he turns the game into "me vs players". RPG doesn't work this way: it's about making story together. Which of course doesn't mean he shouldn't put your characters at risk - if there was a chance that some of you would die (from a bomb in the bottle? Really?) at least he should give you a fair chance to get away from it - i.e. hinting through some NPCs that your target has a habit of putting bombs inside the bottles (again... really?) or give you a chance to roll to notice it and/or avoid the worst of the explosion. Imagine, how bad would Lord Of the Rings be, if hobbits drowned on the ferry while escaping Black Riders?
I presume that both you and the DM are quite new to RPG - maybe let someone else lead the story. Maybe play some printed stories that doesn't have such silly surprises. You are both learning, no reason to be "butthurt" and transfer this feeling to the other games (or even worse - outside of it).
Also, is there a chance that you (or other players) upset the DM? If so.. well The rock falls, everyone dies...