"Which when" is not a phrase on its own. It's an awkward combination of words you get when you sandwich two clauses together.
In your example, if you add commas, it becomes obvious the two clauses are not the same:
I want to adopt a dog which, when patted, leads to hidden treasure.
"When patted" is a sub clause which has been inserted into the sentence. If you remove that clause the whole sentence still makes sense:
I want to adopt a dog which leads to hidden treasure.
So if you want some sample sentences you can just put random clauses in the middle of random sentences!
- Here's a sentence which, when you take out the middle clause, still makes sense.
- She got a new haircut which, when it's windy, blows all around the place.
- I've got a keyboard which, when it's dark, lights up.
You can remove any of those commas and the sentence would still be valid. But it would be harder to read.