I've googled different ways to convert the grease pencil stroke to the mesh. Unfortunately, they all do not respect the stroke thickness, because all the ways that I found use direct conversion to lines/bezier curves/polygon curves. That makes lines have even thickness instead of the thickness of a stroke:
So I have found a workaround: I apply the "Outline" modifier to the stroke first, then I convert the stroke to the polyline, then to mesh, then select all the edges and extrude them, so I have an outline as an extruded mesh:
But this isn't a solution because the extruded mesh does not have caps, having a hole instead. I've tried to fill it using Alt+F, but it fails to fill holes on the complex shapes, especially when line intersects itself. I've tried to autosplit intersecting edges and then Alt+F it again, but it fails to fill the holes correctly because the line is concave: