"De kinderen wonen dichtbij."
Translation:The children live nearby.
Yes, you can use both. Both mean "nearby". Keep in mind that when you say "Ik woon dicht bij mijn ouders" (I live near my parents), the word "dichtbij" is splitted, because what "vlak bij" belongs to (that is "mijn ouders") is behind "vlak bij". If that is not the case (with words like "vlak bij", "dicht bij", "midden in (in the middle of)), the word is not splitted. If you are able to read it, here is the source: https://onzetaal.nl/taaladvies/advies/vlakbij-vlak-bij