Whether an upgrade is possible and if so, how much that will cost depends on country, operator and train.
In some cases, it's not possible at all, e.g. Eurostar.
In some cases, the upgrade is not all that expensive, e.g. domestic TGV in France.
In many cases, you'll have to pay the difference between the full 1st and 2nd class fares.
And in some countries, like Sweden, it is not possible to make an upgrade.
There is also the added complication that upgrades cannot be done online for any operator I can think of so you would have to visit ticket offices or in some cases want until you were on the train.
There is also the added complication that upgrades cannot be done online for any operator I can think of so you would have to visit ticket offices or in some cases want until you were on the train.
You can do it online for some, e.g. for France here:
https://travel.b-europe.com/Eurail-GE/en/booking-tgv#TravelWish
I believe that also works on the SNCF ticket machines.
In Belgium, you can also buy domestic upgrades online. Even for the weekend return reduced fare.
But those are exceptions.
You can also buy online for Switzerland but it is quite expensive.
Much better (and cheaper) to directly buy a 1st class pass !