Hi there Jess, and welcome to Scarleteen.
I'm sorry that you've experienced abuse from multiple people in your life. Freezing up and staying silent are common responses people have to sexual assault, and while I don't have hard data on this I'd bet that they're especially common when it happens within an established relationship. It can be really tough to speak up or react when someone we care about is choosing to harm us; it might be confusing, hard to believe, or feel like it's happening to someone else entirely. Sometimes people blame themselves for not taking more action during an assault, but please remember that this is something your ex chose to do; you aren't at fault for being silent and freezing up when you hadn't given consent in the first place.
It's really common for people to want to know why someone chose to abuse them, but sadly that's a question that rarely has a satisfactory answer. It's not something that an abuser will answer honestly or willingly, and while other people can make guesses about why someone acts a certain way, we really can't know. I think the important thing to keep in mind is that people who choose to be abusive and sexually assault others do it because it's a choice they make - you aren't at fault, here. Are you able to avoid contact with your ex? It sounds terrible to have him continue to tell you that it was your fault that he assaulted you; if you're able to block communication from him, avoid him socially, etc. I think that's the best call.
In terms of forming firm boundaries in the future, you absolutely can practice communicating your needs and boundaries to other people, in all sorts of contexts, and getting used to doing that in all areas of your life can make it easier to communicate your boundaries to future romantic or sexual partners. However, what you can't do is convince or force someone to respect those boundaries and limits when you make them known; like abuse, pushing past or respecting boundaries is a choice someone makes for themself.
What you can do is be really aware if people are trying to test or ignore boundaries; if they continue doing that after you call them on it, deny they're doing it, or blame you for their behavior, that's a really clear sign that they aren't going to be a healthy relationship partner. If you notice people doing this, then they're probably people it's best to steer clear of. Again, I really want to emphasize that if people are choosing to ignore your boundaries, that is something they're doing and not something you're inviting or causing to happen.