As a general rule practicing to putt straight is best done indoors and putting stroke drills to help achieve this are ok to be practised on a carpet. Good putting however needs 'distance control' combined with 'straight putting' and a carpet's speed and texture make it unsuitable to practice distance control.