Not only can a 3 to 4 year old learn another dialect or language easily if he or she perceives both as socially necessary, but if a baby is exposed to two languages or two dialects from infancy on, it will speak both languages perfectly and without an accent. They even use either lan gauge appropriately, speaking, for instance, to their father in one, and their mother in in the other. See my chapter on Bilingualism in my book "Language the Social Mirror, 4th ed." I can't upload it as it is still in press.
We moved from the city to a rural village when my middle son was 7 and the youngest was 5. Within 1 week, the 7 year old spoke with a pure Yankee rural dialect,. He has always been very social. The youngest, however, who was not, retained the dialect of the city. When the middle one was sent to a private school at 13, it took him less than a week to speak with the city dialect. The urban dialect was r-full, but the rural one dropped the post-vocalic and final [r]'s, so the switch was complex in terms of getting phonological rules down pat. As a linguist, I transcribed his speech in both situations, so there results aren't a matter of guessing or memory.
There is a large literature on child language acquisition, much of it based 0n the author's own children's speech at different ages. You should avail yourself of works by Roger Brown, Susan Ervin-Tripp, V. Gathercole, and Lois Bloom, as well as others you will find by googling. In sum. children learn any language or dialect spoken around them only if they have a social need to do so. You can't stop them from speaking like their peers, nor can you make them speak like prestigious speakers if they don't have a social bond with them.