You can't do this in dimension $2$, but you can do it in dimension $4$. First, start with a triangulated homology $3$-sphere $S$, such as the Poincare homology sphere. Let $M=\Sigma S$. This is a homology manifold but is not a manifold. It is more or less constructed to have the property of a homology manifold. (The link of each cone point is $S$, whereas the links of the other points are suspensions of actual spheres, so are spheres.) Intriguingly, if you suspend twice you get an actual sphere. This is the the Double Suspension Theorem of Cannon and Edwards.