With 3D points, and using the same DistanceFunction from here. Since it's a 3D graph, you can move around it. I also added a Manipulate just like in that answer to visually inspect that the periodic NearestFunction was working properly:
SeedRandom[1];
box = {{2, 3}, {2, 3}, {2, 3}};
pts = RandomVariate[UniformDistribution[box], 200];
boxfn[x_, b_] := Mod[x, Subtract @@ b, -0.5 Subtract @@ b]
dist[a_, b_, box_] := Norm@MapThread[boxfn[#1, #2] &, {b - a, box}];
nf = Nearest[pts, DistanceFunction -> (dist[##, box] &)];
radius = 0.25;
(* verify the periodic nf is working *)
Manipulate[With[{near = nf[{x, y, z}, {n, radius}]},
Graphics3D[{
Point[pts],
PointSize[Large], Blue, Point[{x, y, z}],
Red, PointSize[Large], Point[near]
},
PlotRange -> box,
ImageSize -> 250]],
{x, 2, 3}, {y, 2, 3}, {z, 2, 3},
{{n, 8}, 1, 20, 1}]
(* generate the graph of nearest 3 elements within radius *)
g = NearestNeighborGraph[pts, {3,radius}, DistanceFunction -> (dist[##, box] &),
DirectedEdges -> False, GraphStyle -> "LargeGraph"]

The 2D case requires very little modification:
SeedRandom[1];
box = {{0, 1}, {0, 1}};
pts = RandomVariate[UniformDistribution[box], 100];
boxfn[x_, b_] := Mod[x, Subtract @@ b, -0.5 Subtract @@ b]
dist[a_, b_, box_] := Norm@MapThread[boxfn[#1, #2] &, {b - a, box}];
nf = Nearest[pts, DistanceFunction -> (dist[##, box] &)];
radius = 0.25;
(verify the periodic nf is working)
Manipulate[
With[{near = nf[{x, y}, {All, radius}]},
Graphics[{Point[pts], PointSize[Large], Blue, Point[{x, y}], Red,
PointSize[Large], Point[near]}, PlotRange -> box,
ImageSize -> 250]], {x, 0, 1}, {y, 0, 1}]
(generate the graph of all nearest elements within radius)
g = NearestNeighborGraph[pts, {All, radius},
DistanceFunction -> (dist[##, box] &), DirectedEdges -> False,
GraphStyle -> "LargeGraph"]
DistanceFunctionfrom that answer in theNearestNeighborGraph– flinty Jul 09 '20 at 17:27