Yes, straw can be composted – but only as long as it isn’t contaminated with anything on the “don’t compost!” list.
Straw used for pet bedding or in animal runs often has bits of the animal’s poo and whatnot mixed into it – that’s ok for healthy vegetarian animals (like rabbits or chickens) but you shouldn’t compost waste from meat eating animals (or those with that hunt etc), because their faeces can contain dangerous organisms that are not always broken down by the composting process.
Straw used to soak up oil/chemical spills should not be composted – you don’t want those liquids getting into your compost.
Straw is a “brown” in composting terms: add it alongside fresher greens to make sure the heap stays balanced and doesn’t get too dry. It’s also good practice to stir it into your heap so it doesn’t get blown around or form a heavy suffocating layer at the top.