Eighteen countries allow transgender personnel to serve openly in the military, including Australia, Israel, Britain, Sweden and Canada.