If you pull guard on them, you can knee pull them into you and then lock their head with our arm.
This all depends of course. If you look at this question that I asked a while ago, it shows that BJJ is GREAT for self defense against one opponent but not against multiple. If you practice enough, a triangle can take <15 seconds. It takes time. They key for using BJJ in self defense is being able to control the distance between you and your opponent. If you are standing up, keep a far distance until you feel you can do a takedown, and when you do, do it FAST. If you pull guard on them, you can knee pull them into you and then lock their head with our arm. This will make it very hard for them to strike you at all.