I don't think I've ever been asked more for a BJJ tutorial than I have for escaping the straight ankle lock. Clearly, there's a wide demand for this, so here it is! The straight ankle lock can be tough to finish at first, but it's also extremely tough to get out of (relative to other leg attacks). Here, we'll go over two fundamentally sound escapes that you can start using right away, and then take a look at some counters which can result in you getting the submission once you've survived the initial attack.
A good straight ankle lock escape begins with "putting the boot on", which mimics exactly what it describes. If you imagine putting on a boot, you have to both straighten your leg out and curl your toes back toward you ("live toes"). In order to have an effective boot, you really need to start with your quadriceps (and not with your calf or shin). Engage the strongest muscle group in your leg, and then rotate your foot outward as your partner sets up the straight footlock. Next, you need to try to get on top, but this can be a little difficult if your partner is properly using their inside shin to block you. This is where your second foot comes into play, prying apart your partner's knees. Once you have the knees apart, you can follow to the mount position, keeping your foot on their knee to open it up until you've established your position on top.
If you go to put the boot on and you find that you can't (it's too late, or your partner is considerably stronger than you), an alternative plan is the hopover escape. Start by pinning your partner's foot on the ground with your hand, and then simply hop your hips over to the other side of their foot. One you've circled all the way around your partner's legs, you can utilize your free foot to swim and establish a hip-block position, much like knee on stomach. Props to Seph Smith for showing me this escape a few years ago; it has worked very nicely in conjunction with the boot escape.
If you've found that you are unable to shake your partner's control as you try either of the two previous escapes, a counter might be a viable alternative. Start by pinning your partner's inside foot underneath your butt. Once you've sat on your partner's toes, grab their heel and twist it, while maintaining downward pressure on the toes. This will operate much like a heel hook, so this should only be practiced with your instructor's permission and under the proper rule set, but this can be an incredibly effective way to get your partner to move. If their foot comes out in order to prevent the submission, you can easily switch to a toe hold.
Another fantastic counter opportunity arises when your partner steps across with their inside leg, either leaving their foot dangling, or posting on your hip. Slide their foot off of your hip and to the outside if you need to, and then you can simply overhook their ankle for the crossbody ankle lock. This attack is absolutely devastating, and will almost always yield a submission long before the same-side footlock your partner is going for. Further, if you're allowed to do so, you can easily switch to an inverted heel hook (although the straight ankle for you is going to be considerably higher percentage due to the shorter distance you have to travel backward in order to get the submission).
I've been using straight ankle locks for about 20 years now, and while I learned some escapes toward the beginning, it's only much more recently that I've felt extremely comfortable defending the straight ankle lock under nearly all circumstances. Hopefully, this tutorial provides a solid template for you to start defending the most common scenarios you're likely to encounter, and from there, you can grow your own defensive system. While this doesn't happen overnight, it certainly does happen over time! As always, please let me know how these techniques are working out for you.