There are many ways for dogs to get bit by a tick.
First, different types of ticks are found in different areas. It can range from grasslands to light wooded areas. Some ticks, such as the brown dog tick can live inside homes, dog pens, etc.
For more details, check this exhaustive list of ticks and places where they're found.