If I play a custom map in warcraft 3 online (such as dota), will I get a copy of that map?

Before playing any map in warcraft 3, you will be in some kind of lobby. In that lobby every player has the (automatic) ability to download the map from the host (lobby creator). The download progress is indicated by a number in front of the player name counting up from 0 to 100 (%).

Every player needs to download the map for the host to be able to start the game. Once the map is downloaded, it will be located in your local game folder under custom maps (or something similar).

It is worth noting that many hosts are not happy with players downloading a commonly used map before the game, because it takes time, so it might not be easy to make the download. This might no longer be the case, but it used to be that way.

There are also some external lobbies such as garena, dotalicious, etc. Which sometimes modify the lobby in a way that changes from the original. My explanation above regards to the "normal" lobby that is included in warcraft 3 without modifications.