Yes, but the ends could be extended to infinity in arbitrary directions, so we can tie a knot in a line, not just a segment. You can't do that to the edges of a blanket knot (two sides run into the knot).
A mathematical knot is like a loop of string. There are no ends. Of course, you could cut any mathematical knot wherever you like and make the two ends go to infinity if you'd like.
But a knot in a plane segment doesn't need to fold the ends in - I can grab a blanket in the middle, and tie a knot there, then extend edges infinitely still?
I can imagine an infinitely long line with a know in the middle in 3d ... I guess the interesting question is "can you have an infinite plane with a knot in the middle in 5 dimensions?6 dimensions?"