Officially you can’t but you can get away with it the latest 105 and Ultegra 11 speed setups specify a medium cage for 32T cassettes. However I did this recently with Shimano 105 short cage mech and a 32T cassette (10 speed). It ran fine in the small chainring on the 32T cassette, but was not happy in the big ring so I just had to stay out of that combo.
I did have an issue where the cage got tangled up with the chain somehow and it twisted the cage so had to get a new rear mech – not sure what happened as I was not in the big/big combo so maybe I didn’t spend enough time setting up and fine tuning the setup – maybe my chain length was not right. All a bit of a mystery but most likely something to do with my setup with the 32T cassette. Thankfully a new 105 rear mech is only £24. I had no problems over the next 150 miles of riding or so after I replaced the rear mech before putting my 28T cassette back on.
I’ve given it a go but wouldn’t recommend it, not without spending alot of time fine tuning the set up and chain length and thoroughly testing it. However the box for my new 105 short cage mech says the mech has a max capacity of 30T on a 2×10 setup, so maybe give a 30T cassette a go instead of a 32T cassette?