I'm no expert, but this seems to work:
\setupcolors [state=start, system=rgb]
\def\bw#1{\framed[background=color,backgroundcolor=black]{\color[white]{#1}}}
\setuppagenumbering[command=\bw,location={header,margin}]
\starttext
\input tufte
\stoptext
Hello,
How to make page number as white digit in a black square? (And place it on the right of the page)