Thanks for the Clustal Omega tip! However, it calculates the distance with a very simple metric, while I needed MEGA precisely for the K2P-based distance. For anyone else with similar issues, I found an R library that calculates the K2P distance from a DNA alignment in FASTA format:
library(ape)
aln <- read.FASTA("seq.aln")
dist <- dist.dna(aln, model = "k80", as.matrix = TRUE, pairwise.deletion = T)
The output is the same as I get from MEGA with no need to convert to their format.
Since the MEGA format is probably used only by MEGA you are not likely to find and other software that will do that conversion.
I have not used MEGA on the command line but perhaps there are utils in the command line version of MEGA that can do this.