I taught the dog to beg.

Literal

I [topic-は] dog [to-に] begging [object-を] taught.

ちんちん is the command/trick name for a dog standing on its hind legs to 'beg' — a standard dog trick in Japanese. 教える ('to teach') takes に for the learner and を for the content taught. Despite potential for misunderstanding, ちんちん in this context is unambiguously a dog trick.