Was merthyr tydfil the capital of Wales?

No ,it's never been the Welsh capital- up until the Industrial Revolution (1759) it was a small village, and only expanded when iron foundries were established there in the 18th Century (From 1759).