It can happen all of a sudden, yes. Also, I think it's fairly common after having a stomach bug. That happened to my oldest twins when they were a year and a half old. Got the stomach flu and then after they should have gotten over it, every time I gave them a bottle they would bloat up and have horrible runs, and started vomiting again. I went through that for two weeks until I read online that lactose intolerance can happen after a tummy bug.
Switched them to almond milk after reading that and all the symptoms immediately went away. They are able to drink cow's milk again now though.