Yes, you can build an obstacle map for Pathfinding with tilemap. Pathfinding cell size needs to be smaller than the tile size. Set tiles for walls, other tiles need to be empty, or have a collision polygon which allows to pass through them.
Another option is to use EasyStar.JS plugin for tilemaps, it has tons of great features. See the last page for C3 link: