Coming from a striking focused martial art, it seems to me that grappling can only be practiced with a partner. Is there any thing I can do to practice by myself for martial arts like judo, BJJ and sambo? Obviously there is strength training but I would like to focus on technique and learning how to do the moves. I guess watching YouTube videos would help a little. But is there anyway I can practice an arm bar or getting out of headlock alone?
No, there isn't a way to improve technically without a partner in grappling.
You need a good partner for everything in grappling and an experienced instructor to learn a grappling technique.
No grappling dummy will give you resistance and context the way you need it. No training without a partner will give you an idea of actual forces and mechanics. You actually do need multiple partners to learn how to deal with different leverages, different strength levels, different levels of flexibility, speed, etc. And no training without an instructor will be able to make you aware of what you are doing wrong.
The only thing you can do alone, with a grappling dummy, is doing certain speed drills that only make sense after you established proper technique. These are not really good for technical improvement either, they are rather a kind of cardio/coordination training that uses sport-specific movements.
Learning technique should never be done alone since there is a high percentage, even for simple strikes, that you start with minor or major imperfections that will be harder to correct with every wrong repetition. In other words: all you will achieve is becoming really good at being bad. Training for technical improvement without feedback by a partner and corrections by an instructor (these roles can be fulfilled by the same person) is equally a recipe for disaster in grappling since grappling is all about physical feedback.
The best way to improve your grappling without a partner is to have individual sessions that are purely focussed on the underlying body movements associated with jiu jitsu. In the free "Self Mastery" video John Danaher released during COVID he identified a number of specific body movements that can be practiced (repeatedly) solo. These movements when combined, form the basis of many jiu jitsu techniques.
Movements like bridging, hip escaping, shoulder rolls and Granby rolls, technical stand-ups and sit-throughs, BJJ-specific hip and leg mobility drills -- can be practiced alone.
Agreed, difficult to practice technique (locks etc) without a partner but drilling the underlying mechanics will accelerate your technical improvement when you do have a partner to work with.