Option 1 - Quickest way
There is actually a quite immediate way to obtain that effect:
double click on the layer you want to style (in your case the border layer)
under Symbology select Hashed line
play around with the settings. To obtain something similar to the example of the question, set Rotation to 45° (or -45°)
Option 2 - Quick way
Always through a ...
You could create the border as a line then buffer the line the right distance (it will depend of your map scale) to get a polygon and style this polygon with a line pattern fill and no border.
To create the buffer you may use the tool from the processing toolbox (create a new polygon layer) or use the geometry generator in the border line style (better if ...
Open the symbology menu of your layer and choose outline marker line.
Make sure to uncheck rotate marker.
Then navigate to simple marker.
Choose the line as symbol and rotate it by -45°.
Do additional styles if you wish.
Using Gabriel de Luca's answer as a starting point, I set out to find a way to increase the number of nodes. But the geometry generator doesn't have a way to increase the nodes density. I was looking for an equivalent of the densify or points along geometry tools. But then I found another way:
Use the geometry generator to display the polygon border as a ...