When learning another language, especially when you’re getting to that upper level of competency, you come to realize (or perhaps you already know) that there other ways of speaking, or dialects. Each dialect has its own accent, vocabulary, and particular way of saying things. Now, there’s also the standardized version of that language, which is often called, “Standard (insert language here)”. This is the version that is most often taught to non-native learners of the language.
Despite this, I feel that you have a right to pick and choose what you learn and use in learning a language. A lot of Spanish learners, in my experience, feel obligated to only use what they’ve been taught in class. As a learner of a language, you have a certain privilege, or at least opportunity that native speakers may not have.
But the reality is that you can choose what dialect or accent to emulate. If you’re going to be spending a lot of time in a particular region where the target language is spoken, I don’t see why not. Sometimes it may be even necessary, as is the case with the varieties of Arabic: Modern Standard Arabic, Egyptian Arabic, Moroccan Arabic, etc.
In the case where there is a standard, but there are still very distinct dialects, such as in Italian, this is where learners have the dilemma. Students of Italian are typically taught only Standard Italian, which resembles Florentine Italian the most, and as you go out from Rome, Florence, and the other cities in Central Italy, the language is less and less intelligible to the untrained ear. The Sicilian and Milanese varieties sound very different. In such a case, depending on where you are, you should familiarize yourself with what that dialect sounds like, or even try to switch between dialects (if you’re willing to learn the dialects well enough).
The point of learning a language to fluency (in my opinion) is to emulate native speakers. Because there are a great many native speakers, there are also a great many dialects. Therefore, it is up to the learner (after getting down the fundamentals of course) to pick what kind of speaker they want to emulate.