I followed this guide to build the Dongle software
and used this command (substitute where required)
make -f examples/Makefile-nrf52840 USB=1 BOOTLOADER=USB DOT_THREAD_VERSION=1.2
and you can also add JOINER=1 flag above but I don't know if you need it.
If you have a Windows laptop then you can use the gui application "nRF Connect" to program the Dongle.
There are multiple ways to do these things but the way I did required both a Linux computer to compile and then a Windows computer to do the flashing.
Assuming you built the OpenThread Border Router project correctly then you just need to insert the RCP flashed Dongle into a USB port of the pi and reboot, wait a couple of minutes and then use the information in the guide to test the functions.
example of a command you can execute in the Pi:
sudo ot-ctl state