Redirection from one domain to another domain

Can we have the following redirection in hugo setup to

can we write in htaccess?

htaccess is specific to the Apache web server. If you are asking about if Hugo can write to an htaccess file, the answer is yes, as a custom output format. If you have a question about other stuff (not Hugo), please search elsewhere.