You mean like this stuff (not my pic)?
I've seen a fair few people with these fixed to their seatpost at XC races. I'm not sure how well it'd work for sealing up MTB innertubes, I think it's mostly recommended for road use with inner tubes or MTB use for tubeless/UST.
I thought about getting a can for racing last year but I quickly realised that I'll never be near enough the front to be bothered about a few extra seconds putting a tube in if my existing tubeless setup doesn't seal, and 7€ a shot for something that is pretty big and might not work seems a bit excessive.
If you're getting a lot of thorn punctures then going tubeless (with sealant) is the best way to go. Some people find it a faff to set up, but for me it's been worth it.