Welcome to CV. The default form of matching used in
MatchIt is propensity score matching. This involves computing a propensity score for each unit and then finding control units with similar propensity scores to treated units and discarding the rest. The propensity score acts as a summary of all the covariates included in its calculation, so it doesn't matter what types of variables they are; you are only performing the matching on the propensity score itself and all information about the covariates is lost during the match. For other types of matching, such as Mahalanobis distance matching, the types of the variables do matter because matching is done on the covariates in a more direct way.
Regarding the programming aspect, R automatically creates dummy variables when they are included in the model formula (i.e.,
A ~ X1 + X2) and are stored as factors or characters in your dataset. If the variable is stored literally in your dataset as the numbers
3, R has no way of knowing that you intend for that variable to be categorical rather than quantitative. Questions about specific programming languages are not on topic for this site, but you can ask questions on StackOverflow about how to use R.