Create a specific paragraph style with a tuned tab position: type of tab is Right and you set it to the right margin. You must compute the distance from the left margin taking into account the width of your left/right margins.
There is a shortcoming here: in all document processors I know of, tabs are anchored at left margin (mirror this for RTL languages) which needs manual adaptation when you change paper format (portrait → landscape, or DIN Ax → US sizes) or even modify your margins. I suggested an enhancement to define an anchor for tab based on relative position (such as “anchor for this tab is set at x% of page width or paragraph area width and measure distance from this anchor”). This proposal has been discarded because it would require substantial modification to ODF and could cause dramatic incompatibilities with existing documents.
The only “magical” tab which automatically aligns with right margin is in Contents x paragraph styles family used to display table of contents.