Yes cotton can and does sometimes shrink in the dryer especially if you use too high of a heat setting on the dryer.
Another reason that cotton will sometimes shrink in the dryer is because the mechanical action of the dryer will cause the fibers and yarns to come closer together which leads to the fabric and cotton shrinking.
To prevent the cotton laundry from shrinking in the dryer you should dry the cotton on the lowest heating setting or consider drying the cotton laundry outside on a clothesline or inside on a clothesline.
Some clothes just don't do well when dried using a tumble dryer and actually drying clothes outside on a clothesline when possible makes the clothes much fresher and also saves you money on your electricity bill.
I do a lot of my clothes drying outside when it's nice and it makes the clothes much fresher and saves me money.