Pet deposits are not illegal....however i f there was a lease in place and it did not require a pet deposit I question why one would agree to modify a lease .
AS an aside, in some circles, LL s treat pet deposits as Non refundable...take care...and take a lot of pictures especially if there is any existing /prior damage. .
in defense of LLs and as a retired LL, I just spent 4 days of craftsmanship with a friend to fix damage done to a modest home by a "small" dog and as a LL I've had to replace an entire living room hardwood floor because of a small dog and an inattentive owner