There is two way to get close to what you're looking for.
The first one is a symbol with three layer (bottom to top):
- original polygon
- line fill
- negative buffer (geom generator) to mask the line inside the original polygon
this solution let you create some nice effect, for example using a gradient going to transparent to let the line fade slowly...
The second one create a donuts and is only the result of a geometry generator with a two layer symbol (simple fill below, line fill on top)
None of these solution will give you the 45° angled line relative to your polygon border, I don't know how it could be done without looking bad at the corner
I hope the following screen grab are clear enough (I use a (negative) buffer size of 100 relative to my polygon, you'll have to adjust the value to your need)
buffer($geometry,-100)
1
2
difference($geometry,buffer($geometry,-100))