Doing that still works in Scotland, but you might run into trouble in England. England now has deposits limited to 5 weeks rent.
Pet deposits seem like a decent way of compromising tbh, a dog can cause well over the normal deposit worth of damage to carpets let alone anything else if it’s not well trained.