。
She told me she wanted to keep a dog as a pet.
Literal
She [topic-は] dog [object-を] pet [as-に] want-to-keep [quotative-と] me [target-に] said.
Two distinct uses of に in one breath: ペットに marks 'as a pet' — the role-assignment に, the same one in 先生になる ('become a teacher') or プレゼントに買う ('buy as a gift'); 私に marks the addressee of 言う. The verb 飼う is reserved for 'keep, raise (an animal/pet),' a different word from the 'raise (a child)' verb 育てる. The original speaker's 飼いたい (first-person desire) is preserved inside the quotation marked by と; with no quotation marks in Japanese writing, the と alone tells you the embedded clause was an utterance.