Block diagram of M-PSK modulation and demodulation
So this seems to be a general block diagram for these types of modulations.

No, this is a block diagram of a IQ upconverter with some unspecified digital data modulator on the input.
You need to mentally divide the modulation from the tools you use to implement it. There's other architectures that can produce the same signal (and they're not uncommon).

But the block diagram shows that the modulator uses low-pass filters (LPF).

Yeah, that block diagram is admittedly not in a shape that I find good: it omits where the transition from digital to analog happens, where the transition from bits to symbols happens, and a few other things.
But yeah, the author of that block diagram probably meant these LPFs to signify pulse shaping filters. We can't be sure from the block diagram alone.

From what I've read, these modulations mostly use raised cosine/root raised cosine filters.

Again, no, please make sure you're not confusing the constellation (BPSK, QPSK, …) with the system, or with the pulse shaping.
RC and RRC (and basically, all pulse-shaping filters) are low-passes, so &quot;LPF&quot; covers these quite well, and RC and RRC are far from the only choice there, even if they are a &quot;textbook favorite&quot;. They are popular in practice, too, indeed, but you got to realize that your textbook teaches you about the untruncated RRC and its matched filter (which happens to be itself) and their combination RC, but in reality, you have truncated versions combined with channel impulse responses and equalizers, so, make sure you don't learn that there's a &quot;RRC in the block diagram at that position&quot;, but to understand that it's a pulse-shaping filter, and RRC is a common choice, for mathematical reasons.
A lot of your argument is &quot;usually it's done like this and that&quot;, and reality is that there's reasons, and just knowing what is often done isn't taking you far!

Why do most of the block diagrams show blocks with this particular filter? Is it simply because it's a generic diagram?

Again, the block diagram you've shown is not that of a PSK transmitter, but that of a input data-to-bandpass signal direct converter, and not a great one at that. Of course it doesn't show your favorite pulse-shaping filter, as that choice isn't applicable to all systems covered by this, so you're absolutely right.

I have this block diagram:


That is the block diagram of a receiver architecture that is honestly doing a different kind of abstraction than your transmitter diagram, and honestly, again omits what these LPFs are for (here, they have a very important different role, namely to remove the upconversion result and obtain the baseband signal!), omits that there's some digitization going on... Again, I don't think this is a great diagram.
Also, this diagram, while underspecifying a lot of things, makes a distinct choice in terms of synchronization: The carrier recovery is done purely, it seems, on the RF signal, and without any baseband feedback, and then symbol timing is estimated on that, there's no phase recovery...
honestly, I think you need a better textbook that explains what does which in a simple circuit, instead of giving you a diagram that shows something particular and leaving it up to you, with incomplete information, to match up your knowledge on modulations with that.

Will it work for any M-PSK modulation (BPSK, QPSK, 8-PSK, 16-PSK etc.)?

No, this thing has no chance to correct phase due to the purely feed-forward nature of the carrier recovery (can't do a PLL without a loop). As such, it makes little sense to even do this in IQ.
So, doesn't work for complex constellations and certainly not for PSKs.

Or is it only valid for QPSK?

Not valid for QPSK.

Won't the block diagram look different for e.g. BPSK modulation?

Any sensible block diagram for any PSK looks different.

Will the general block diagram for M-PSK modulation look the same? And if not, what would such a diagram look like?

Your real question is &quot;how does a PSK receiver look like&quot; and the answer is: there's multiple architectures you can apply.
You're clearly learning complex baseband / direct conversion techniques. So, please, use your textbook (or a better one) to learn that. A typical downconverting mixer in a modern system looks something like this:

(the low-pass filters in here have a single purpose: they filter away the mixing products of the oscillator frequency $f_{LO}$ and the carrier frequency $f_c$ at $f_{LO}+f_c$ and higher intermodulation products, and limit the bandwidth of the signal so that the ADC can sample it alias-free.)
And all the frequency, phase, timing synchronization, the matched filtering, and the decision is done on the digital side, and will look differently for different systems, and depend on more factors than whether you choose QPSK or 8-PSK or 1024-QAM or 2-FSK or GMFSK or whatever.
I think the key point I want to make here is: very few use cases¹ build an analog signal chain that is specific to the modulation used in the signal in the last 20 years. In that, the diagrams you've shown are simply from a time &quot;long past&quot;, and give you irrelevant or even obsolete detail in some aspects, and omit relevant things in others.
Learn about what complex baseband is, and what these mixers do, and the rest will become more easily understandable to you. Watch out that you don't conflate the terms of modulation, modulator, and the individual implementation of it. Generally, a good textbook's didactic approach (reading it linearly from front to back) is much faster at helping you understand what you need to do than trying to match incomplete understanding of a few things to multiple resources.
I think you're more of a practically-minded nature and it's probably a stretch assuming you'd want to learn lots of theory rather than learning the common tools of the trade and why and how they work. So, Robin Getz' and Travis Collins' SDR for Engineers (PDF) might really be where you want to start reading. Your confusion about what the components of a receiver are is cleared up in the first 15 pages!
Make it through the first four chapters, and you can draw better diagrams than I did here, and that you've got so far. It's literature time that will definitely pay off, because this sounds like you've got a project to approach – and that will require you to make informed decisions :) And: it's actually not all that hard.

¹ and especially not the cases you should be learning first