There is no global rule specifying which court/country is responsible. Instead, B decides where to try and file the suit, and that court then decides whether it accepts the suit or not. It might very well be that multiple courts would accept it, if B brings it to them (however, I do believe it is standard that if one court accepts a suit, any other you may approach will reject it for that reason). It could also be the case that they all say no (maybe the German court declines because the tweets are in Thai, the Thai court declines because they don't have the opportunity to actually punish A, and the US courts decline because it is obviously covered by the first amendment there).
When B approaches a particular court, they will have to make a case that this court indeed has jurisdiction. Sometimes, B will also need to argue that the court is indeed a better choice than the alternatives, in other cases, any vaguely reasonable choice is good enough [this is eg already relevant when it comes to the question where inside Germany to bring a defamation suit].
Relevant questions will be in which language the tweets were written, where the people reside with whom B's reputation is tainted, etc.