I think that if you have enough ambition and commitment, it is basically no problem to learn an instrument such as the piano via youtube or the internet (up to a certain, individual, level).
However, this method obviously lacks feedback and (hopefully positive) pressure. Which is given by traditional learning with a private piano teacher or at a music school. Of course, you don't get feedback on the interpretation of a piece of music via YouTube.
Only your own audio/video recordings can help here. But for that you have to be very self-critical and especially the evaluation of the current performance always requires the perspective of an expert (teacher), which of course you cannot have yourself in principle.
In short, to a certain extent, certainly. Above a certain level, difficult/impossible.
With instruments where the tone production itself is a challenge (e.g. trumpet), I would not assume that self-study can be successful at all. Of course, there are exceptions here too......