It is not dangerous, and does not perform the same operation (it is actually incorrect and incomplete: ":" and "#" swapped, and missing substitution words). I guess it was downvoted because it didn't explain? The bash manual does, though, under "HISTORY EXPANSION". Try this:
Type a command, but don't press enter, e.g.
echo 'hello';
Type
!#:s/hello/world/
Press enter. !# means the whole current command so far, and the s/a/b/ modifier replaces the first instance of "a" with "b".
Press up to get the command that ran:
echo 'hello'; echo 'world';
To see such history expansion things before they are run, press M-^ (probably Alt-Shift-6).