Depending on the quality of the strings you use, your playing style, and how often you play, bass strings can indeed snap. While such unpleasant events rarely happen, they might prove to be dangerous, especially if the strings snap while you’re playing. If you use light gauges and you often engage in an aggressive playing style, you are more likely to see your strings breaking.
However, there are some things you can do to reduce the risk of breaking your strings. First of all, choose the right string gauge and types for your playing style and music genres. Then make sure that you install the strings correctly and you don’t bend any of the string along its length when doing that.
Check the bass bridge and frets carefully, in case it’s the same string that snaps. There might be a sharp spur somewhere on the saddle that causes such incidents.