It's possible to get HIV if you have infected blood in your mouth and there are any cuts in your mouth.
If you have no cuts in your mouth, then I am not sure if you could get HIV when the blood gets into your stomach. Other people's blood can have a lot of nasty stuff though, so it's best to avoid getting it in your mouth altogether whenever possible.
If you had blood in your mouth and now are wondering if you might have HIV, the only way to know for sure will be to take a test.