Yes, upgrade from SQL 2012 (Standard) to SQL 2017 (Standard or Enterprise) is supported as long as the SQL 2012 is SP2 or higher.
As for the license part, generally, if you have the software assurance covered, the upgrades may already be included, in which case, you shouldn't need to pay for the upgrade but if you don't have SA, then you would need to talk to a licensing specialist
to explore your upgrade options.
I would advise that you do a side-by-side upgrade (and not in-place). That way, you would have the lower environment to fall back in case things don't work out in the higher environment. But then you may have to pay full licensing since you would be installing
a new server altogether. Either way, check with a licensing expert on that part.
Please remember to click "Mark as Answer"
if my response answered your question or click "Vote as helpful"
if it helped you in any way.