Should columns with close to zero variance be removed before or after one hot encoding?
I think 1st you need to remove the columns with near to zero variance(assuming that they are not nominal variables), only if you have more variables as the computation time can be reduced.

Let us consider a scenario where there are 2 columns col1, col2 and you checked for variance then col1 had 0.003 variance and col2 had 0.5 var. once you apply the function nearZeroVar(), it removes col1, you need to hot-encode only 1 variable.

By that you can save time and your computer performance won't be effected.