Very simplified
Dengue has multiple strains. The initial infection with one strain tends to be not so bad and you may acquire immunity to it. However, it triggers a much worse, often hemorrhagic outcome if you acquire one of the other strains.
Vaccines, afaik mirror that property, changing the risk calculation by removing the less risky first infection.