The desire to add horizontal lines to the page number in the header or footer and display it as “- 1 -”, “– 1 –” or “— 1 —”, for example, is not uncommon, although such a display is often perceived as old-fashioned in scientific documents. One possibility would of course be to redefine the plain and headings page styles (using the scrlayer or scrlayer-scrpage package) so that the dashes are directly part of the page style. Depending on the document setting—for example twoside or not—the page number is output at a different position and depending on this either the scrlayer-scrpage instruction \cfoot resp. \cfoot* or \ofoot resp. \ofoot* should be used. The same applies when using other page style packages such as scrlayer-fancyhdr.
With the KOMA script classes, it is easier to achieve the desired result by redefining \pagemark. By default, the definition is
\DeclareRubustCommand{\pagemark}{{\usekomafont{pagenumber}{\thepage}}}
The desired dashes can simply be inserted, for example by adding
\DeclareRobustCommand{\pagemark}{{\usekomafont{pagenumber}{--~\thepage~--}}}
or
\DeclareRobustCommand{\pagemark}{--~{\usekomafont{pagenumber}{\thepage}}~--}
to the document preamble.
The difference between the two redefinitions is that in the first case, the font for the element pagenumber also affects the dashes, whereas in the second case, only the page number is set in the font of this element. As a rule, you will therefore want to use the first version.
As the scrlayer package used by scrlayer-scrpage also provides \pagemark, this solution can also be used with the standard classes as soon as scrlayer-scrpage (or scrlayer) is loaded. When using \DeclareRobustCommand, it does not matter whether the redefinition takes place before or after loading scrlayer-scrpage. If you use \RenewDocumentCommand instead, for example in the form:
\RenewDocumantCommand{\pagemark}{}{{\usekomafont{pagenumber}{--~\thepage~--}}}
this can also be done together with a KOMA script class either before or after loading scrlayer-scrpage. With other classes, however, the instruction should usually be after loading scrlayer-scrpage.
The use of \renewcommand or \renewcommand* to redefine \pagemark is not recommended, as the original definition in scrlayer is also robust.
\thepage instead of \pagemark. However, this is not recommended, as otherwise the dashes would also be used in directory entries, for example in the table of contents, list of figures or list of tables or in page references with \pageref.-, -- or ---, you can of course also use more complex shapes and ornaments, for example with the help of TikZ.