Suppose now I am interested in University A and a Journal B. I want to know how many people from University A published a paper in Journal B, and what are these papers. How to do this?
Unfortunately, affiliations are a mess. People in bibliometrics usually say that you have to know the institution and its various names, acronyms, institutes, and laboratories very well, to capture all publications from the institution. If you have this knowledge, set up a corresponding search query (advanced search) for Web of Science (you need to have access to this database via your institution) and add the journal as additional condition.
Another approach is to check whether the institution you look at has a publications database and you can search for specific journals in there.
In mathematics, you should be able to do this in MathSciNet (subscription required).
Here is an example I did.
Ohio State University Math department, published in Proceedings of the American Mathematical Society.
JOURNAL Proc Amer Math Soc
I get 102 results.
You have to look up the codes for the items you want. If I just put "Ohio State" for the institution I seem to get lots of things that are not matches.
I would suggest to use lens.org which is free, and where you can use many simultaneous conditions in order to perform the search you are talking about. It is really easy to use, so I would recommend you to give it a try.