Can I use granulated sugar instead of demerara sugar
Yes, it will work just fine, but it won't have the same color or the slightly molasses flavor of demerarra.  It also has a finer crystal size, usually, so the texture will be a little less distinctive.

The closest substitute for this purpose, if you happen to have it, is sanding sugar--but I imagine that not everyone keeps that on hand.  It has a large crystal size, and so presents a nice crunchy topping on muffins or shortbread or similar.