Sure you can. In fact, it’s even easier than when I was a kid and tried to teach myself the harmonica from a tatty, old primer. Now, thanks to the masses of ‘how to’ videos on Youtube, you can learn almost anything online – in fact it’s become my first port of call when I need to do something I’ve not done before.
However, while it’s fairly straightforward using YouTube to teach yourself how to replace an iPad screen or build a brick pig house (both of which I did thanks to online videos), learning an instrument in this way is not ideal. The problem is that, at some point, you’re going to reach a point where you need one-to-one guidance and what tends to happen is that people either try to struggle through and then give the whole thing up as too difficult… or they get a teacher.
I’m certainly not suggesting you’d need a teacher for the long term — I once took on a pupil for four weeks just to work through a specific area of technique — but having a teacher can help to encourage you to press on, to avoid incorrect technique, answer specific questions as they arise, and ensure you have appropriate repertoire.