Yes! Though you may not be able to get a lot of what you want for free.
Basically all of the box score information that we have is in the public domain So it's all available for free from retrosheet.
However, that's not a very usable format. Thus several services (including the ones that MLB and it's announcers use, Stats Inc) are available for you to peruse. However, this is expensive data to maintain and format, so you'll probably need a subscription to use it.
Baseball Reference is perhaps the most comprehensive publicly available store of baseball records (and can definitely do the kinds of queries your curious about). They will offer a limited amount of data for free, and all of the results of your queries if you're a subscriber. If you have an actual need for this, it's quite affordable.