I had that happen to me, couldnt even open my mouth to brush my teeth. Go back to the dentist! I disagree with the doc, do not try to force it that can make it worse! I thought mine was a seized up muscle or something too but it was not that at all. Please, dont force it until you have it checked out. Mine was locked because removing the tooth the dentist somehow damaged the disc in my jaw. I had to have two additional surgeries done by another specialist to repair it and reposition the jaw disc.He said sometimes they can right themselves on their own too. I still have a hard time keeping my jaw open at the dentist or opening my mouth wide. Unfortunately, this sometimes can happen when having teeth extracted. It isn't that your dentist did something wrong necessarily either, it is just one of those unfortunate possible outcomes. I hope this is not what has happened to you, but don't force it, get it checked out and possibly see a specialist for a second opinion.
I am not sure the trismus(difficulty in opening your jaw) is related to the dry socket. two weeks seems like a long time for the dry socket to last. I am more inclined to think that the trismus is related to the injection. I suggest you try to force open your mouth a little at a time each day. You might try using tongue blades between your teeth and increasing the number each day. If this does not work then you might have to go to an oral surgeon and under sedation have your jaw opened to break any adhesions that are present.