An ultimatum says “you must do X or else I will do Y”
A boundary says “you must refrain from X or else I will do Y”.
An ultimatum says “you must do X or else I will do Y”
A boundary says “you must refrain from X or else I will do Y”.
You make a distinction without a difference. In either case, without providing for compromise or alternative mutual understanding, it is likely confounding and demanding.
Additionally, an ultimatum comes with a deadline; a boundary is indefinite (until stated otherwise).
In a sexual relationship context, that distinction could be better illustrated by:
"Don't touch me like that again without asking first, or I will break up with you"
vs
"If you don't have sex with me by the end of the week, I'll break up with you".
An ultimatum is, to most people, inherently damaging to psychological safety. A boundary is not automatically better - it can be unreasonable, unhealthy, or incompatible with the other persons needs - but unlike an ultimatum, it's not _inherently_ harmful to the relationship.