Ants do not harm peonies nor damage the flower buds as they crawl over them. Peony buds produce sugars, amino acids and water on their outside edges, and the ants feed on those nectars.
The old myth that ants help the peony buds to open has been proved incorrect, as peony buds open with or without the assistance of ants. They are attracted to the plant’s nectar as well as the nectar excrement left by mites and aphids.
There is a benefit to having ants on the buds, however, because they can keep away insects that will nibble those buds. When the buds form in the spring, mites and aphids are attracted to them.
The only potential harm ants could do to the peony bud is to spread disease, particularly botrytis blight, which is a fungal disease that will infect the buds that ants feed off of. It also will infect the stems and leaves, visible as a fuzzy mold. Remove infected parts, even flower buds, when they appear, and use a spray formulated to manage the disease.