Considering your specific usage, they are certainly occasionally interchangeable... but there many options and which one fits best really depends on what sounds "right".
Let's look at your first example:
I was talking with my friend via Skype.
Personally, I would probably not use "by" in this case. My first choice here would be to use "on" followed by either "via" or possibly "through". Others may feel that "by" works great here.
The second example (I've replaced "somewhere" with "work"):
I went to work by tram.
This works great for me... I might also say "I went to work on the tram." Via could also be a possibility here.
All that said, "via" is a bit of an odd word. Some people may use it regularly in their vocabulary but I'll bet that most people don't. That doesn't mean that you shouldn't use it, it's mostly something I felt worth pointing out.