1. It is no use crying over spilt milk.

(Does 'it' refer to 'crying ....'?)

2. Walking alone at night is dangerous.
3. It is dangerous to walk alone at night.
4. It is dangerous walking alone at night.

(Are the three sentences the same? Which one is commonly used?)

1. No. "It" is just being used as that general introductory pronoun that refers to nothing (except maybe to the whole situation).

2, 3, and 4 all mean the same thing. 2 and 3 are fairly commonly used.