When traveling through a land border, you can get one at the border crossing by stopping at an immigration office or applying online. The FMM form for Mexico can only be filled in online if you travel by land, it cannot be filled in online if you're traveling by sea or air.