I wouldn’t recommend working on distance control unless you have a carpet with a short pile. Even then you would probably be better off getting a properly designed putting mat. If you are merely working on the mechanics of your stroke then there is nothing stopping you from working on that on your carpet at home. For example, if you’re worried about the path of your putter head on short putts. You could straighten it out by practicing up against the skirting board. Alternatively, you could place two clubs parallel,  a putter head width apart, and use that as a guide for working on your stroke.