Yes, you can keep an inchworm as a pet.
a inch worm
inch worm
The right way to say inch worm in Spanish is, oruga
inch forward
If you have a pet worm, you need to keep it in a pretty big container with a lot of dirt (usually a good sized fish tank, around 10 gallons, with a minimum of about 2 gallons). Worms eat dirt, so only dirt is accepted.
Inch-worm.
inch worm
you don't...
Canker worm
Slimey!
wormy,wormington,wormalisious
It won't be a problem for the worm-- they get along perfectly in the wild after all. You might have trouble seeing your pet, though.