If you mean, you want to actually generate the texture, then as GG says, it's really a matter of wrapping the coordinates when sampling the image. A function that creates a grass texture for instance might start with pure black, then add green noise randomly over the image, then smooth it out - very basic. The problem would arise when the smoothing function gets to the edges, as it should blend the wrapped coordinates to make it seamless. So if you sampled a 3x3 area of the image, I would have that done with a function that checks the image dimensions, and adjusts the passed coordinates to suit.
Ideally you would have a function to return the pixel colour at a given location based on X and Y coordinates that you would specify. If a coordinate is below 0 then add the image width or height, and if a coordinate exceeds the image width or height, decrease it. This way your sampling would account for wrapping textures, and it would generate perfectly seamless textures for you.
So it might just be a case of making a special wrapping POINT function, depends on what sort of textures you want to make. Along with general noise being used for grass - you might use it for stone, then add in some crack lines (moving a point randomly 'dragging' a crack), wrap this in the same way, and you'll keep the texture seamless.
Personally, I would make some functions that can be run in sequence to create different textures - like a function to take 2 colours and fill an image with noise based on these colours - and a function to smooth out, add cracks etc. You can even add details from other images, like a little flower - then paste it 9 times, 1 centre paste, then the image width and height added and subtracted so that if the sprite overlaps an edge, it will be seamless because the same sprite is pasted at the opposite edge.
There's lots of techniques out there that are worth looking into, perlin noise etc, I would try and get the basic grass in there then investigate some procedural texture generation techniques.