You can probably do this legally if you’re moving the fence farther away from the property line. However, many fences won’t stand up to being moved. You may need to construct a new section.