No you cannot hold a sloth in Costa Rica or at any other place.
Holding Sloths in Costa Rica is not allowed as it's not good for the sloths health to be held by a human and most sloths do not like to be held anyway.
Sloths also get stressed out quite a bit when humans are holding them.
Also sloths can transmit bacteria to humans which can make the humans sick.
So you should never hold a sloth although it would be great to do so.
When I was in Costa Rica I saw signs that said that the sloths could not be held.
If anyone at any sanctuary tries to let you hold a sloth then they will get into trouble.