Agree with iskra1916 that we do not know the full details regarding your dog or the circumstances. So while here's an advice, please do use your own judgment to see if it is applicable to your situation and more importantly, if it is safe for you to follow these instructions.
Next time around, don't try to directly remove the item from its mounth. Instead try to exchanging something else, eg a treat or its favourite toy, for the item in its mounth. Waive it around and try to get your dog excited by this new item your are waiving. If you are able to capture its interest, it will very likely drop the item in its mouth and come to you for this new item. Using this new item as a lure, lead it a safe distance away from the item it has just dropped so that you can safely pick it up after you have given your dog the new item.
If you are into clicker training, you can easily train the "leave it" cue so that you can eventually get your dog to release items on command.
Hope the above helps.