Yes, but it would not likely retain the hydrogen very long or at all. Hydrogen can diffuse through solid metal, hydride technologies are a much better option. If you were to use aerogel you would probably have to inpregnate hydrogen into it, seal it, seal it again, then to release it you would have to dissolve the sealent, and place it under a vacuum to get all the hydrogen out, good idea though.
http://en.wikipedia.org/wiki/Hydrogen_economy
Aerogel is better suited to applications like supercapicators, thermal insulation ect.