If you just want to redefine one or two commands for a specific document or so, doing it in the preamble is probably most straightforward. If the commands contain @, you need to treat that specially:
\documentclass[10pt,notitle,nologo,totpages]{europecv}
% How to acheive the line below?
% \def\ecv@namekey{\ecv@utf{Name}}
\makeatletter% because the line includes @ we nest the redefinition this way
\def\ecv@namekey{\ecv@utf{Name}}
\makeatother% make sure to return to normal before continuing
\ecvname{Pouya}
\ecvtelephone{+1234567890}
\ecvemail{foo@bar.com}
\begin{document}
\begin{europecv}
\ecvpersonalinfo
\ecvsection[-1cm]{Current position}
\ecvitem{}{In front of the computer}
\end{europecv}
\end{document}

If you want to make more extensive changes which you'll use in many documents, it is easiest to create a custom package or class to keep everything together. The details really depend on the particular case.
First, some packages and classes will use a custom configuration file if you create one. It is always worth checking for this since it is often the easiest and most robust way to customise. However, I read through the documentation of europecv and that doesn't seem to be an option in this case.
Second, for very simple cases, you can just use \input{myfile} and keep customisations in myfile.tex. Something like:
\ProvidesFile{myfile}
% some stuff here
\makeatletter% because the line includes @ we nest the redefinition this way
\def\ecv@namekey{\ecv@utf{Name}}
\makeatother% make sure to return to normal before continuing
\endinput
Then use \input{myfile} in your preamble.
Third, you can put customisations in a style file (mystyle.sty). Again, there are different approaches but, for example:
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mystyle}
\RequirePackage{some package}
\def\ecv@namekey{\ecv@utf{Name}}% note - no need for \makeatletter... in this case.
% some stuff
Fourth, you can write a custom class (myclass.cls) which loads the original class with particular options. The main reason to do this would be if it isn't possible to make the changes you wish after the main class is loaded so a style file won't work. There are different ways of doing this but, for example:
\NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
[1994/12/01]% LaTeX date must December 1994 or later
\ProvidesClass{europecv-mine}
% stuff here
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{europecv}}
\ProcessOptions*
\LoadClass[10pt,notitle,nologo,totpages]{europecv}
\RequirePackage{some package}
% more stuff
\def\ecv@namekey{\ecv@utf{Name}}% note - no need for \makeatletter... in this case.
\endinput
Finally, if you want to make very extensive changes, you can copy a class or style file to a new name and modify it. For example, you could copy europecv.cls to my-europecv.cls and modify it appropriately. Note that you will not benefit from future updates to the main class unless you update your modified code. On the other hand, that may mean that your customisations are less likely to break.
Licensing is a legal issue and off-topic for this site. So I will not comment on that aspect of your question.