Yes.
Ailments can also be gotten contagiously from other Sims, public toilets, waking up (I think this is like feeling under the weather and may get better/turn into an Ailment) and by becoming Very Imbalanced through neglecting Sims physical needs /Motives and mental health/Emotions.
Some bigger life events, like Grief can also throw off your Balance and also having Bad Luck can make you more prone to them, as percentages increase for bad things to happen. If you keep your balance high, you should se them less, but there's a pretty short cooldown on them (there's already mods out to extend the cooldown if you use them).
Though it's not all bad news. Because Ailments are magical illnesses, and nature is all about Balance, every Ailment has an upside, as well as a down side.