Vegas Pro comes with a variety of supported video codecs, if the codec your video was encoded with is not supported, then you might not be able to edit the video, or Vegas might even crash.
For example, the reason why you can not open all AVI files in Vegas Pro, is that not all .avi files are the same. The file extension of video files usually dose not have anything to do with the codec used to encode the file, and should be thought of as just the container format.
Changing the file extension does not actually change the format of the container either, so be very careful when using such hacks.
A few examples of good formats for Vegas Pro are: MPEG-2, MPEG-4 and H.264 (x264) using either the MPG or MP4 container. So, if your file for some reason does not work, try converting it to one of those formats. It also depends on what version of Vegas you got, if possible, try to update Vegas to the latest version.
Some older versions of Vegas might not support x264 files very well, which means .MP4 files and some .AVI files. For older versions, MPEG-2 and MPEG-4 might work.
For a recommendation on video conversion see also: How to get any video to work in Vegas Pro
Codecs and container formats
Generally, a good container format would be MP4, as a lot of videos are distributed as MP4 files, and newer versions of Vegas handle them very well. The codec should be chosen carefully, depending on what the requirements are for the video.
If you want to get the smallest file size possible, then you should likely try to experiment with the AVI container and DIVx / xVID codecs, or MP4 with x264.
Another possibility, if you need to edit the video later, is to use the MPEG-4 codec with the MP4 container. It is important that you remember to adjust the bitrate, as MPEG tend to require higher bitrate than DIVx and XVID to get the same quality. A good place to start is around 5k, and then move it up as needed.
Putting things in perspective, good quality can be achieved with as little as 1-2k in bitrate with some codecs, but Vegas might not be able to edit the files.