It is legally allowed as long as you stick to the terms of the font's license - usually the OFL.
You'll need a set of web font formats, and the Font Squirrel Webfont Generator can produce these.
But the OFL required the fonts be renamed if they are modified, and using the generator means modifying them.