All depends on if it has a short or medium cage mech on it, and also what chainrings are on the front.
The upper limit of a short cage rear mech is usually between 28 to 30 teeth. Medium will then do 32 to 34 (and occasionally push to 36). This can be pushed on some bikes or by hacking by turning B screw around (see at bottom).
On the front it makes a difference if it has a typical 6 tooth gap i.e. 50/34 or 52/36 or if was a CX type set with 46/36.
It isn’t so much about the cage length giving clearance for a big cog but giving sufficient chain length to run say a 34-32 and then sufficient tension back in a 50-11. A shorter cage ends up at one extreme of gears back tight or slack at the other as can’t really do both. You may also find you lose certain gear combinations if it gets too tight.
If you have a short mech there are a couple of ways to sort it though (in descending price order):
Shimano now do cassettes with a 30, may be able to get one for £30-35. Obviously costs and isn’t as small a gear as a 32, but a 30 usually work with a short cage. Have seen one bike where the mech hanger shape didn’t quite allow it to work though even the B screw wound right in.
New mech with longer cage – new a 105 mech is £30ish, a second hand 105 mech should be £15, and you can even swap the cage with a longer one (making sure it isn’t bent) – have seen LBS give these away after a groupset swap if you know a friendly one?
For a tenner you can get a mech hanger extender, I tried a pattern one off ebay for £6 and it worked fine. Basically spaces out the mech to clear the bigger cog.
The free bodge option that might be worth a try is to take out the B screw and put it back in the other side. It’s obviously a pain to adjust once on but it might give the clearance for the 32. I used this on a medium cage mech to give the extra couple of mm to run a 36 cassette quite comfortably but then ran 36/46 front chainrings.