Your example sentences might mean the same thing. Commonly, they would be taken in the same way.
In the first sentence, there is only one city and it happens to be 30 miles from Toronto. That is the city in which he lives.
(As comments have said, if there is more than a single city 30 miles from Toronto, then the definite article should be replaced by the indefinite article.)
The second sentence is most likely interpreted in just that way too.
But there is another possible interpretation of the second sentence—even though it would normally only be understood if a comma were used to stress its meaning:
He lives in the city, 30 miles away from Toronto.
Rephrasing it further makes this other interpretation even clearer:
He lives in the city—not in the country—and is 30 miles away from Toronto.
Here, city is being used to describes the type of place in which he lives rather than singling out one place in particular.